本帖最后由 a87750530 于 2013-5-19 16:09 编辑
如下面的代码,想给一个批处理生成桌面快捷方式,可是win7下不能生成,请教是不是因为桌面路径不对,导致程序不能运行,应该怎么调整?- @echo off
- >"2.vbs" echo Set WshShell = WScript.CreateObject("WScript.Shell")
- >>"2.vbs" echo strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
- >>"2.vbs" echo set oShellLink = WshShell.CreateShortcut(strDesktop ^& "\小工具.lnk")
- >>"2.vbs" echo oShellLink.TargetPath = "%~dp0\小工具.bat"
- >>"2.vbs" echo oShellLink.WindowStyle = 1
- >>"2.vbs" echo oShellLink.Hotkey = ""
- >>"2.vbs" echo oShellLink.IconLocation = "%~dp0\03.ico, 0"
- >>"2.vbs" echo oShellLink.Description = ""
- >>"2.vbs" echo oShellLink.WorkingDirectory = "%~dp0\小工具.bat"
- >>"2.vbs" echo oShellLink.Save
- call "2.vbs"
复制代码 xp下没有问题,win下就出错 |