我正在使用批处理脚本创建一个url快捷方式,但由于某种原因它没有设置图标我告诉它设置...
代码:
echo [InternetShortcut]> "C:\winapps\SysNetworkManager.url"
echo URL="C:\winapps\snmres\winstart.bat">> "C:\winapps\SysNetworkManager.url"
echo IconFile="C:\winapps\snmres\snmico.ico">> "C:\winapps\SysNetworkManager.url"
echo IconIndex=0>> "C:\winapps\SysNetworkManager.url"
它不会将图标设置为C:\ winapps \ snmres \ snmico.ico,而是设置此图标:C:\ Windows \ system32 \ url.dll
答案 0 :(得分:0)
尝试创建临时VBS
@echo off
set SCRIPT="%TEMP%\%RANDOM%-%RANDOM%-%RANDOM%-%RANDOM%.vbs"
echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%USERPROFILE%\Desktop\myshortcut.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo oLink.TargetPath = "D:\myfile.extension" >> %SCRIPT%
echo oLink.Save >> %SCRIPT%
echo oLink.IconLocation = "C:\myicon.extension" >> %SCRIPT%
cscript /nologo %SCRIPT%
del %SCRIPT%`