本帖最后由 zaqmlp 于 2019-5-15 22:22 编辑
以管理员身份运行- @echo off
- rem 指定谷歌浏览器的安装程序
- set "exefile=D:\ChromeInstall.exe"
-
- rem 执行安装
- "%exefile%"
-
- rem 修改桌面快捷方式并添加到启动文件夹
- (echo;Set ws=CreateObject^("WScript.Shell"^)
- echo;Set fso=CreateObject^("Scripting.FileSystemObject"^)
- echo;inkfile="":t=ws.SpecialFolders^("DeskTop"^) ^& "\Google Chrome.lnk"
- echo;If fso.FileExists^(t^) Then inkfile=t
- echo;t=ws.SpecialFolders^("AllUsersDeskTop"^) ^& "\Google Chrome.lnk"
- echo;If fso.FileExists^(t^) Then inkfile=t
- echo;If inkfile="" Then WSH.Quit
- echo;Set a=ws.CreateShortcut^(inkfile^)
- echo;Set b=ws.CreateShortcut^(inkfile^)
- echo;b.TargetPath=a.TargetPath
- echo;b.WorkingDirectory=a.WorkingDirectory
- echo;b.Arguments=WSH.Arguments^(0^)
- echo;If fso.FileExists^(inkfile^) Then fso.DeleteFile inkfile,True
- echo;b.Save
- echo;WSH.echo inkfile ^& "|" ^& ws.SpecialFolders^("Startup"^) ^& "\Google Chrome.lnk"
- echo;WSH.Quit)>"%tmp%\#t.t"
-
- for /f "tokens=1* delims=|" %%a in ('cscript -nologo -e:vbscript "%tmp%\#t.t" "-参数"') do (
- del /a /f /q "%%b"
- copy "%%a" "%%b"
- )
-
- rem 禁用Tablet PC
- reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\TabTip.exe" /v debugger /t reg_sz /d debugfile.exe /f
- reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v 1 /t REG_SZ /d "TabTip.exe" /f
- reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v DisallowRun /t REG_DWORD /d 1 /f
- taskkill /f /im explorer.exe
- start explorer
- pause
复制代码
|