2
我想用這樣的批處理文件來創建與圖標桌面快捷方式:如何使用批處理文件在桌面上使用圖標創建快捷方式?
set SCRIPT="%TEMP%\theiboosts1.vbs"
echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%USERPROFILE%\Desktop\Internetovy Booster.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo oLink.TargetPath = "c:\Booster\booster.bat" >> %SCRIPT%
echo oLink.Save >> %SCRIPT%
"%windir%\system32\timeout.exe" /t 5
start wscript.exe "%SCRIPT%"
"%windir%\system32\timeout.exe" /t 10
echo Const DESKTOP = &H10&>>"%TEMP%\testboost.vbs"
"%windir%\system32\timeout.exe" /t 5
echo Set objShell = CreateObject("Shell.Application") >>"%TEMP%\testboost.vbs"
"%windir%\system32\timeout.exe" /t 5
echo Set objFolder = objShell.NameSpace(DESKTOP) >>"%TEMP%\testboost.vbs"
"%windir%\system32\timeout.exe" /t 5
echo Set objFolderItem = objFolder.ParseName("Internetovy Booster.lnk") >>"%TEMP%\testboost.vbs"
"%windir%\system32\timeout.exe" /t 5
echo Set objShortcut = objFolderItem.GetLink >>"%TEMP%\testboost.vbs"
"%windir%\system32\timeout.exe" /t 5
echo objShortcut.SetIconLocation "C:\Windows\System32\SHELL32.dll",-16752 >>"%TEMP%\testboost.vbs"
"%windir%\system32\timeout.exe" /t 5
echo objShortcut.Save >>"%TEMP%\testboost.vbs"
"%windir%\system32\timeout.exe" /t 5
start wscript.exe "%TEMP%\testboost.vbs"
"%windir%\system32\timeout.exe" /t 5
但它寫了一個錯誤:
Syntex of the command is incorrect
但
"%windir%\system32\timeout.exe" /t 10
之間沒有命令
和
echo Const DESKTOP = &H10&>>"%TEMP%\testboost.vbs"
當我創建.vbs文件是否正常工作
Const DESKTOP = &H10&
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.NameSpace(DESKTOP)
Set objFolderItem = objFolder.ParseName("Internetovy Booster.lnk")
Set objShortcut = objFolderItem.GetLink
objShortcut.SetIconLocation "C:\Windows\System32\SHELL32.dll",-16752
objShortcut.Save
有人能幫助我嗎?
THX傑森!我忘了我必須在特殊字符之前寫^。 :d – TheGameSpider