VBS创建修改快捷方式
Set WshShell = WScript.CreateObject("WScript.Shell") strDesktop = WshShell.SpecialFolders("Desktop") '在“桌面”创建一个记事本快捷方式 set oShellLink = WshShell.CreateShortcut(strDesktop & "\游戏菜单.lnk") oShellLink.TargetPath = "G:\bat\BBSClient\BBSGameMenu.exe" '可执行文件路径 oShellLink.Arguments = "" '程序的参数 oShellLink.WindowStyle = 1 '参数1默认窗口激活,参数3最大化激活,参数7最小化 oShellLink.Hotkey = "" '快捷键 oShellLink.IconLocation = "G:\bat\BBSClient\Material\ico.ico, 0" '图标 oShellLink.Description = "游戏菜单" '备注 oShellLink.WorkingDirectory = "G:\bat\BBSClient" '起始位置 oShellLink.Save Dim fso Set fso =CreateObject("Scripting.FileSystemObject") fso.DeleteFile WScript.ScriptFullName
以上为创建快捷方式,复制到记事本,另存为byben.vbs,开机启动运行即可
Dim objShell, objFolder, objFolderltem, objShellLink Set objShell = CreateObject("Shell.Application") ''创建对象 Set objFolder = objShell.NameSpace(&H00) ''创建文件夹路径 Set objFolderltem = objFolder.ParseName("游戏菜单.lnk") Set objShellLink = objFolderltem.GetLink ''创建快捷方式对象 objShellLink.Path = "G:\bat\BBSClient\BBSGameMenu.exe" ''修改目标路径 objShellLink.WorkingDirectory = "G:\bat\BBSClient" ''修改工作目录为桌面 objShellLink.Description = "这是一个快捷方式" ''修改描述 objShellLink.SetIconLocation "G:\bat\BBSClient\Material\ico.ico", 0 ''修改图标 objShellLink.Save ''保存 Dim fso Set fso =CreateObject("Scripting.FileSystemObject") fso.DeleteFile WScript.ScriptFullName
以上为修改快捷方式,复制到记事本,另存为byben.vbs,开机启动即可