返回列表 发帖
回复 1# 15158795291
  1. @echo off
  2. %1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("""cmd""","/c """"%~f0"""" ::",,"runas",1)(close) & exit /b
  3. setlocal enabledelayedexpansion
  4. REM 查找.exe路径
  5. set "keyPath=HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths"
  6. set "exeName=HC Touch VPro.exe"
  7. set "foundPath="
  8. set "softwarePath="
  9. for /f "tokens=*" %%a in ('reg query "%keyPath%" /s /f "%exeName%" /k 2^>nul') do (
  10.     set "thePath=%%a"
  11.     if "!thePath:~-1!"=="\" set "thePath=!thePath:~0,-1!"
  12.     for /f "tokens=2,*" %%b in ('reg query "!thePath!" /ve 2^>nul') do (
  13. set "type=%%b"
  14. set "value=%%c"
  15. if "!type!"=="REG_SZ" (
  16. set "foundPath=!value!"
  17. goto :endSearch
  18. )
  19.     )
  20. )
  21. :endSearch
  22. set "softwarePath=!foundPath!"
  23. echo !softwarePath!
  24. pause
复制代码
测试代码之前请做好备份

TOP

返回列表