original.bat 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. @setlocal enabledelayedexpansion
  2. @echo off
  3. @rem 要求以管理员方式启动
  4. bcdedit >nul
  5. if '%errorlevel%' NEQ '0' (goto UACPrompt) else (goto UACAdmin)
  6. :UACPrompt
  7. %1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
  8. exit /B
  9. :UACAdmin
  10. color 0F
  11. @cls
  12. title 【可视柜台应用程序安装脚本】
  13. for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
  14. set "DEL=%%a"
  15. )
  16. cd /d "%~dp0"
  17. @set /a argumentNum=0
  18. @set ret=0
  19. @rem 1 关机 2 重启
  20. @set poweroffPC=0
  21. @set /a installType=0
  22. @set installPure=1
  23. @for %%a in (%*) do set /a argumentNum+=1
  24. @if %argumentNum% gtr 0 (
  25. @echo argument count: %argumentNum%
  26. @if %argumentNum% == 1 (
  27. @if "%1" == "uninstall" (
  28. @set installType=4
  29. ) else if "%1" == "pure" (
  30. @set installType=1
  31. )
  32. )
  33. ) else (
  34. @echo no any arguments
  35. )
  36. @echo [RVCTermianal] ========== Install Start ==========
  37. @echo 安装脚本模式: %installType%
  38. @set sysProductKey=
  39. for /f "skip=1 delims==" %%i in ('wmic path softwarelicensingservice get OA3xOriginalProductKey') do (
  40. @set sysProductKey=%%i
  41. @goto DoneGetProductKey
  42. )
  43. :DoneGetProductKey
  44. @echo sysProductKey=%sysProductKey%
  45. if "%sysProductKey%" == "" (
  46. @echo [DEBUG] 操作系统未激活!
  47. ) else (
  48. @echo [DEBUG] 操作系统已激活。
  49. )
  50. @set ROOT=%cd%
  51. @set rvc_src_path_rvc_dir=%ROOT%\rvc
  52. @set rvc_src_path_Run_dir=%ROOT%\Run
  53. @set rvc_src_path_rvc_res_dir=%rvc_src_path_rvc_dir%\Resources
  54. @set rvc_install_path_root=%HOMEDRIVE%:
  55. @set sysdisk=1
  56. @set lnkPath=spexplorerauto.lnk
  57. @set AutoStartDir=C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  58. @set AutoStartDir2=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
  59. @set VS2019MarkFile=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe
  60. tasklist /nh | find /i "spshell.exe"
  61. @if errorlevel 1 (
  62. @echo [INFO] 可视柜台进程不存在,跳过进程清理
  63. ) else (
  64. @echo [INFO] 检测到可视柜台进程存在,开始清理可视柜台相关进程……
  65. TASKKILL /F /IM spshell.exe
  66. TASKKILL /F /IM guardian.exe
  67. TASKKILL /F /IM cefclient.exe
  68. @for /f "tokens=1,2 delims= " %%a in ('tasklist /m ^| findstr "sphost.exe"') do (
  69. @echo name=%%a, PID = %%b, and will kill it.
  70. TASKKILL /F /PID %%a
  71. )
  72. )
  73. @rem 如果是非生产环境并且且是开发者的电脑在安装版本,那么部分公共的设置不生效,例如壁纸,开机自启动
  74. @if %installType% equ 0 (
  75. @if exist "%VS2019MarkFile%" (
  76. @call :ColorText E0 "[WARN] 检测到当前安装的系统环境为开发人员环境,将跳过部分设置,避免影响开发日常工作"
  77. @set installPure=0
  78. )
  79. )
  80. @echo installPure=%installPure%
  81. @if exist "D:\\" (
  82. @if exist "D:\\Run\\version\\vtm.exe" (
  83. @set rvc_install_path_root=D:
  84. @set sysdisk=0
  85. ) else (
  86. @set rvc_install_path_root=D:
  87. @set sysdisk=0
  88. )
  89. )
  90. @echo [DEBUG] rvc_install_path_root=%rvc_install_path_root%
  91. @echo [DEBUG] rvc_src_path_Run_dir=%rvc_src_path_Run_dir%
  92. @set rvc_install_path_rvc_dir=%rvc_install_path_root%\rvc
  93. @set rvc_install_path_rvc_res_dir=%rvc_install_path_root%\rvc\Resources
  94. @set rvc_install_path_Run_dir=%rvc_install_path_root%\Run
  95. @set rvc_install_path_hardware_dir=%rvc_install_path_Run_dir%\hardwarecfg
  96. @set rvc_install_path_versions_dir=%rvc_install_path_Run_dir%\version
  97. @echo [DEBUG] rvc_install_path_rvc_dir=%rvc_install_path_rvc_dir%
  98. @echo [DEBUG] rvc_install_path_rvc_res_dir=%rvc_install_path_rvc_res_dir%
  99. @echo [DEBUG] rvc_install_path_Run_dir=%rvc_install_path_Run_dir%
  100. @echo [DEBUG] rvc_install_path_hardware_dir=%rvc_install_path_hardware_dir%
  101. @echo [DEBUG] rvc_install_path_versions_dir=%rvc_install_path_versions_dir%
  102. @set RVCTerminalDirName=
  103. @set RVCTerminalDirFullPath=
  104. @set RVCCurInstallVersion=
  105. @for /d %%a in (%rvc_src_path_Run_dir%\version\*) do (
  106. @set RVCTerminalDirFullPath=%%a
  107. @set RVCTerminalDirName=%%~nxa
  108. @goto GetRVCTerminalDirNameDone
  109. )
  110. :GetRVCTerminalDirNameDone
  111. @set RVCCurInstallVersion=%RVCTerminalDirName%
  112. @echo [DEBUG] RVCCurInstallVersion=%RVCCurInstallVersion%
  113. @if exist %rvc_install_path_hardware_dir%\root.ini (
  114. @echo [WARN] 存在root.ini文件,认为是存量安装,跳过版本清理操作
  115. ) else (
  116. @echo [INFO] 清理(删除)历史版本(如有)......
  117. @if exist %rvc_install_path_Run_dir% rd /S /Q %rvc_install_path_Run_dir% > nul 2>&1
  118. @if exist %rvc_install_path_rvc_dir% rd /S /Q %rvc_install_path_rvc_dir% > nul 2>&1
  119. @echo [INFO] 清理(删除)历史版本(如有)OK!
  120. )
  121. @if %installType% equ 4 (
  122. @echo [INFO] 清理(删除)历史版本(如有)......
  123. @if exist %rvc_install_path_Run_dir% rd /S /Q %rvc_install_path_Run_dir% > nul 2>&1
  124. @if exist %rvc_install_path_rvc_dir% rd /S /Q %rvc_install_path_rvc_dir% > nul 2>&1
  125. @echo [INFO] 清理(删除)历史版本(如有)OK!
  126. @goto setAutoStartWithRegist
  127. )
  128. @if not exist "%rvc_install_path_rvc_dir%" md "%rvc_install_path_rvc_dir%"
  129. @if not exist "%rvc_install_path_rvc_res_dir%" md "%rvc_install_path_rvc_res_dir%"
  130. @if not exist "%rvc_install_path_Run_dir%" md "%rvc_install_path_Run_dir%"
  131. @if not exist "%rvc_install_path_hardware_dir%" md "%rvc_install_path_hardware_dir%"
  132. @if not exist "%rvc_install_path_versions_dir%" md "%rvc_install_path_versions_dir%"
  133. @echo 【0/1】拷贝RVC目录...
  134. @xcopy %rvc_src_path_rvc_dir% %rvc_install_path_rvc_dir% /E/Y/Q
  135. @echo 【1/1】拷贝RVC目录OK!
  136. @echo 【1/2】拷贝终端版本,文件数量较多,部分终端拷贝时间比较长,请稍加等候......
  137. @if exist %rvc_src_path_Run_dir%\hardwarecfg ( xcopy %rvc_src_path_Run_dir%\hardwarecfg %rvc_install_path_hardware_dir% /E/Y/Q )
  138. @xcopy %rvc_src_path_Run_dir%\version %rvc_install_path_versions_dir% /E/Y/Q
  139. @echo 【2/2】拷贝终端版本OK!
  140. @echo 【2/3】设置系统桌面壁纸
  141. @set FileCount=0
  142. @set desk_path=%USERPROFILE%\Desktop
  143. @set desk_path_pub=C:\Users\Public\Desktop
  144. @echo [DEBUG] desk_path=%desk_path%
  145. @if %installPure% equ 0 (
  146. @call :ColorText E0 "[WARN] 开发设备不清理桌面和设置壁纸,直接跳过"
  147. @goto doNotRunUpdatePerEtc
  148. )
  149. @echo [INFO] 清理桌面文件内容
  150. @for /d %%a in (%desk_path%\*) do (
  151. @echo [DEBUG] %%a
  152. @rd /S /Q "%%a"
  153. )
  154. @for %%a in (%desk_path%\*) do (
  155. @echo [DEBUG] %%a
  156. @del "%%a"
  157. )
  158. @for /d %%a in (%desk_path_pub%\*) do (
  159. @echo [DEBUG] %%a
  160. @rd /S /Q "%%a"
  161. )
  162. @for %%a in (%desk_path_pub%\*) do (
  163. @echo [DEBUG] %%a
  164. @del "%%a"
  165. )
  166. @echo [INFO] 清理桌面 此电脑 图标
  167. reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 1 /f
  168. reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 1 /f
  169. @echo [INFO] 清理桌面 回收站 图标
  170. reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {645FF040-5081-101B-9F08-00AA002F954E} /t REG_DWORD /d 1 /f
  171. reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {645FF040-5081-101B-9F08-00AA002F954E} /t REG_DWORD /d 1 /f
  172. @echo [INFO] 清理桌面 网络 图标
  173. reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {F02C1A0D-BE21-4350-88B0-7367FC96EF3C} /t REG_DWORD /d 1 /f
  174. reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {F02C1A0D-BE21-4350-88B0-7367FC96EF3C} /t REG_DWORD /d 1 /f
  175. @echo [INFO] 清理桌面 控制面板 图标
  176. reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0} /t REG_DWORD /d 1 /f
  177. reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0} /t REG_DWORD /d 1 /f
  178. @echo [INFO] 清理桌面 用户的文件 图标
  179. reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {59031a47-3f72-44a7-89c5-5595fe6b30ee} /t REG_DWORD /d 1 /f
  180. reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" /v {59031a47-3f72-44a7-89c5-5595fe6b30ee} /t REG_DWORD /d 1 /f
  181. @echo [INFO] 清理桌面文件内容OK!
  182. @set WallpaperPath=%rvc_install_path_rvc_res_dir%\WallPaper1920.png
  183. @if not exist C:\Windows\Web\Wallpaper\WallPaper1920.png (
  184. @if exist "C:\Windows\Web\Wallpaper" (
  185. @copy %WallpaperPath% C:\Windows\Web\Wallpaper
  186. @set WallpaperPath=C:\Windows\Web\Wallpaper\WallPaper1920.png
  187. )
  188. ) else (
  189. @echo [DEBUG] 指定壁纸已存在系统目录
  190. @set WallpaperPath=C:\Windows\Web\Wallpaper\WallPaper1920.png
  191. )
  192. @echo [DEBUG] WallpaperPath=%WallpaperPath%
  193. @echo [INFO] 通过注册表设置桌面壁纸
  194. reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d %WallpaperPath% /f
  195. reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /t REG_DWORD /d 2 /f
  196. @call :ColorText E0 "[WARN] 通过注册表设置桌面壁纸OK!(部分机器需要重启后才生效,请注意观察)"
  197. @echo 【3/3】设置系统桌面壁纸OK!
  198. @rem taskkill /f /im explorer.exe
  199. @rem cmd /c start explorer
  200. @echo 【3/4】设置隐藏系统任务栏
  201. @rem reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3" /v Settings /t REG_BINARY /d 01000000000000000000000000000000 /f
  202. @rem reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 2 /f
  203. @rem reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideTaskbar /t REG_DWORD /d 1 /f
  204. @rem reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 1 /f
  205. @rem reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideTaskbar /t REG_DWORD /d 0 /f
  206. @rem mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):a.Run""taskbar.exe /hide"",0,False:close")
  207. @call :ColorText E0 "【4/4】隐藏系统任务栏功能还在测试验证中(部分系统适用)"
  208. @rem powershell -command "&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3';$v=(Get-ItemProperty -Path $p).Settings;$v[8]=2;&Set-ItemProperty -Path $p -Name Settings -Value $v;&Stop-Process -f -ProcessName explorer}"
  209. RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
  210. @rem 将任务栏自动隐藏选项切换为关闭
  211. @rem powershell -command "&{$p='HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3';$v=(Get-ItemProperty -Path $p).Settings;$v[8]=2;&Set-ItemProperty -Path $p -Name Settings -Value $v;&Stop-Process -f -ProcessName explorer}"
  212. :doNotRunUpdatePerEtc
  213. @echo 【4/5】设置可视柜台应用程序开机自启动
  214. @if %installType% neq 1 (
  215. @if %installType% neq 4 (
  216. @goto setAutoStartWithStartup
  217. )
  218. )
  219. @rem 生产安装和卸载模式才执行,通过注册表设置开机自启动
  220. :setAutoStartWithRegist
  221. @echo [DEBUG] 读取注册表信息,判断是否已经设置开机自启动,如果未设置或者之前设置为脚本自启动,修改为通过VTM.exe自启动
  222. @set regFile=%TEMP%\rvc_spshellautostart.reg
  223. @set regTmpFile=%cd%\rvckey.txt
  224. @set explorerKey=
  225. @set needSetAutoStartFlag=1
  226. @set explorerNormal=0
  227. regedit /e %regFile% "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
  228. @rem 每个包含在字符串内的引号必须使用两个双引号括起来
  229. @type %regFile% | find /I """Shell""=" > %regTmpFile%
  230. @for /f "usebackq delims== tokens=2" %%a in (%regTmpFile%) do (
  231. @set explorerKey=%%~a
  232. )
  233. @del %regFile%
  234. @del %regTmpFile%
  235. @echo [DEBUG] original explorer key:%explorerKey%
  236. @for %%i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do call set explorerKey=%%explorerKey:%%i=%%i%%
  237. @echo [DEBUG] explorer key:%explorerKey%
  238. @if "%explorerKey%" == "explorer.exe" (
  239. @echo [DEBUG] 检测到未设置为开机自启动模式
  240. @set explorerNormal=1
  241. ) else if "%explorerKey%" == "d:\\run\\version\\vtm.exe" (
  242. @call :ColorText 2F "检测到已设置为VTM.exe开机自启动模式"
  243. @set needSetAutoStartFlag=0
  244. ) else if "%explorerKey%" == "wscript d:\\run\\version\\spexplorerfast.vbs" (
  245. @echo [DEBUG] 检测到已设置为VBS脚本开机自启动模式
  246. )
  247. @if %installType% equ 1 (
  248. @if %needSetAutoStartFlag% equ 1 (
  249. @echo [DEBUG] 设置可视柜台应用程序开机自启动(同时屏蔽桌面)
  250. @echo [DEBUG] 临时存储设置开机自启动的注册表脚本
  251. @echo Windows Registry Editor Version 5.00 > %regFile%
  252. @echo. >> %regFile%
  253. @echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >> %regFile%
  254. @if %sysdisk% equ 1 ( echo "Shell"="c:\\run\\version\\vtm.exe" >> %regFile% ) else ( echo "Shell"="d:\\run\\version\\vtm.exe" >> %regFile% )
  255. @echo "Shell1"="explorer.exe" >> %regFile%
  256. @echo [DEBUG] 更新注册表!
  257. regedit /s %regFile%
  258. @del %regFile%
  259. @rem @set poweroffPC=2
  260. )
  261. )
  262. @if %installType% equ 4 (
  263. @if %explorerNormal% neq 1 (
  264. @echo [DEBUG] 取消可视柜台应用程序开机自启动(同时恢复桌面)
  265. @echo [DEBUG] 临时存储取消开机自启动的注册表脚本
  266. @echo Windows Registry Editor Version 5.00 > %regFile%
  267. @echo. >> %regFile%
  268. @echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon] >> %regFile%
  269. @echo "Shell1"="d:\\run\\version\\vtm.exe" >> %regFile%
  270. @echo "Shell"="explorer.exe" >> %regFile%
  271. @echo [DEBUG] 更新注册表!
  272. regedit /s %regFile%
  273. @del %regFile%
  274. @rem @set poweroffPC=2
  275. )
  276. @echo [DEBUG] 移除自启动文件
  277. @echo [DEBUG] AutoStartDir=%AutoStartDir%
  278. @echo [DEBUG] AutoStartDir2=%AutoStartDir2%
  279. @if exist "%AutoStartDir%\%lnkPath%" (
  280. @echo [DEBUG] 移除自启动文件1
  281. @del "%AutoStartDir%\%lnkPath%"
  282. )
  283. @if exist "%AutoStartDir2%\%lnkPath%" (
  284. @echo [DEBUG] 移除自启动文件2
  285. @del "%AutoStartDir2%\%lnkPath%"
  286. )
  287. @goto End
  288. )
  289. @goto DoneAutostartSet
  290. :setAutoStartWithStartup
  291. @rem 测试环境,通过程序管理设置开机自启动
  292. @rem 移除旧有的可视柜台自启动快捷键(通过安装程序自动生成的)
  293. @for %%i in ("%AutoStartDir2%\招商银行可视柜台*.lnk") do (
  294. @echo [DEBUG] %%i
  295. @del "%%i"
  296. )
  297. @set targetPath=%rvc_install_path_versions_dir%\vtm.exe
  298. @if %installPure% equ 1 goto setAutoStartAndDesktopIcon
  299. @call :ColorText E0 "[WARN] 开发设备不设置开机自启动,仅设置桌面图标"
  300. mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b1=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\可视柜台.lnk""):b1.TargetPath=""%targetPath%"":b1.WorkingDirectory=""%rvc_install_path_versions_dir%"":b1.Description=""招行可视柜台终端应用"":b1.Save:close")
  301. @goto DoneAutostartSet
  302. :setAutoStartAndDesktopIcon
  303. @echo [INFO] 设置应用自启动和桌面图标
  304. @rem ResourceWatcher:可视柜台.lnk
  305. @rem RVCTerminalApplication:招商银行可视柜台.lnk
  306. mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""startup"") & ""\%lnkPath%""):b.TargetPath=""%targetPath%"":b.WorkingDirectory=""%rvc_install_path_versions_dir%"":b.Description=""招行可视柜台终端应用"":b.Save:Set b1=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\可视柜台.lnk""):b1.TargetPath=""%targetPath%"":b1.WorkingDirectory=""%rvc_install_path_versions_dir%"":b1.Description=""招行可视柜台终端应用"":b1.Save:close")
  307. :DoneAutostartSet
  308. @echo 【5/5】设置可视柜台应用程序开机自启动OK!
  309. @goto End
  310. :InstallError
  311. @set ret=1
  312. :End
  313. @if "%ret%" == "1" (
  314. @call :ColorText 4F "[ERROR] 安装失败,具体失败步骤见上方描述!!"
  315. @pause
  316. @goto Done
  317. )
  318. @call :ColorText 2F "[INFO] ===所有安装步骤执行成功,正常退出,请双击桌面图标启动可视柜台应用进入安装配置,可视柜台应用版本号:%RVCCurInstallVersion%==="
  319. @set /a timoutsecs=5
  320. @echo [INFO] %timoutsecs%s 后自动退出该执行脚本并最小化到桌面
  321. @for /l %%a in (1, 1, %timoutsecs%) do (
  322. timeout 1 > nul
  323. @set /a lastsecs=%timoutsecs%-%%a
  324. @echo [INFO] !lastsecs!s 后自动退出该执行脚本并最小化到桌面
  325. )
  326. @echo 最小化到桌面
  327. @rem MinimizeAll ToggleDesktop
  328. mshta VBScript:Execute("Set a=CreateObject(""Shell.Application""):a.MinimizeAll:close")
  329. @rem @start %rvc_install_path_versions_dir%
  330. :Done
  331. @exit %ret%
  332. :stringLenth
  333. @set thestring=%~1
  334. @if not defined theString (
  335. @set Return=0
  336. @set %2=0
  337. @goto :eof
  338. )
  339. @set Return=0
  340. :stringLenth_continue
  341. @set /a Return+=1
  342. @set thestring=%thestring:~0,-1%
  343. @if defined thestring goto stringLenth_continue
  344. @if not "%2"=="" set %2=%Return%
  345. @goto :eof
  346. :ColorText
  347. @rem color 2F 这里的2代表背景,F代表字色
  348. @rem 0=黑、1=蓝、2=绿、3=浅绿、4=红、5=紫、6=黄、7=白、8=灰、9=淡蓝、
  349. @rem A=淡绿、B=淡浅绿、C=淡红、D=淡紫、E=淡黄、F=亮白
  350. <nul set /p ".=%DEL%" > "%~2"
  351. @findstr /v /a:%1 /R "^$" "%~2" nul
  352. @del "%~2" > nul 2>&1
  353. @echo.
  354. @goto :eof