标题: 怎样利用bat文件在收藏夹中创建快捷方式
[打印本页]
作者: 59fei
时间: 2007-7-9 13:53
标题: 怎样利用bat文件在收藏夹中创建快捷方式
如题:
下面是在桌面创建快捷方式的方法:
请问怎么在收藏夹中创建快捷方式呢
cd.>tmp.vbs
for /f "usebackq skip=4 tokens=*" %%a in (%0) do @echo %%a>>tmp.vbs
tmp.vbs&del tmp.vbs /q
goto :eof
Rem 以下为VbScript脚本
Set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop") :'特殊文件夹“桌面”
Rem 在桌面创建一个记事本快捷方式
set oShellLink = WshShell.CreateShortcut(strDesktop & "\记事本.lnk")
oShellLink.TargetPath = "notepad.exe" : '目标
oShellLink.WindowStyle = 3 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink.Hotkey = "Ctrl+Alt+e" : '快捷键
oShellLink.IconLocation = "notepad.exe, 0" : '图标
oShellLink.Description = "记事本快捷方式" : '备注
oShellLink.WorkingDirectory = strDesktop : '起始位置
oShellLink.Save : '创建保存快捷方式
Rem 在桌面创建一个“微软中国”的Url快捷方式
set oUrlLink = WshShell.CreateShortcut(strDesktop & "\微软中国.url")
oUrlLink.TargetPath = "http://www.microsoft.com/china"
oUrlLink.Save
作者: 59fei
时间: 2007-7-9 13:56
我找到答案了 Desktop 直接换成 收藏夹文件名就行了
可是无论怎样 老是报错
[
Last edited by 59fei on 2007-7-9 at 02:12 PM ]