用VBS才能实现所有效果:- Set WshShell = WScript.CreateObject("WScript.Shell")
- strDesktop = WshShell.SpecialFolders("AllUsersDesktop") '在桌面创建一个快捷方式
-
- set oShellLink = WshShell.CreateShortcut(strDesktop & "\记事本.lnk") '快捷方式名称
-
- oShellLink.TargetPath = "C:\WINDOWS\NOTEPAD.EXE" '目标
-
- oShellLink.WindowStyle = 1 '参数1默认窗口激活,参数3最大化激活,参数7最小化
-
- oShellLink.Hotkey = "" '快捷键
-
- oShellLink.IconLocation = "C:\WINDOWS\NOTEPAD.EXE, 0" '图标
-
- oShellLink.Description = "" '备注
-
- oShellLink.WorkingDirectory = "C:\WINDOWS\" '起始位置
-
- oShellLink.Save '创建保存快捷方式
复制代码 如果想用批处理,给你个思路:
把上面的代码写入VBS再运行!- @echo off
- >"%userprofile%\桌面\2.vbs" echo Set WshShell = WScript.CreateObject("WScript.Shell")
- >>"%userprofile%\桌面\2.vbs" echo strDesktop = WshShell.SpecialFolders("AllUsersDesktop")
- >>"%userprofile%\桌面\2.vbs" echo set oShellLink = WshShell.CreateShortcut(strDesktop ^& "\记事本.lnk")
- >>"%userprofile%\桌面\2.vbs" echo oShellLink.TargetPath = "C:\WINDOWS\NOTEPAD.EXE"
- >>"%userprofile%\桌面\2.vbs" echo oShellLink.WindowStyle = 1
- >>"%userprofile%\桌面\2.vbs" echo oShellLink.Hotkey = ""
- >>"%userprofile%\桌面\2.vbs" echo oShellLink.Ic
- >>"%userprofile%\桌面\2.vbs" echo oShellLink.Description = ""
- >>"%userprofile%\桌面\2.vbs" echo oShellLink.WorkingDirectory = "C:\WINDOWS\"
- >>"%userprofile%\桌面\2.vbs" echo oShellLink.Save
- call "%userprofile%\桌面\2.vbs"
- del/f/q "%userprofile%\桌面\2.vbs"
复制代码
[ 本帖最后由 lzwudi 于 2008-10-7 00:25 编辑 ] |