帮帮忙,帮我完善一下这个VBS脚本。
来源:百度知道 编辑:UC知道 时间:2024/09/21 13:31:41
Rem 文件名:CreateShortCut2Desktop.vbs
Rem 添加程序、文件夹、网站的快捷方式到桌面的示例小程序
Rem =============================================
Rem 初始化
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
Rem 添加 ABC.exe 的快捷方式到桌面
set oShellLink = WshShell.CreateShortcut(strDesktop & "\ABC.lnk")
Rem oShellLink.TargetPath = WScript.ScriptFullName
oShellLink.TargetPath = "C:\A\ABC.exe"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = ""
oShellLink.IconLocation = "C:\A\ABC.exe, 0"
oShellLink.Description = "ABC"
oShellLink.WorkingDirectory = "C:\A\"
oShellLink.Save
上面是个创建快捷方式的小脚本,其中的程序路径C:\A\是固定的,我能不能改动一下,达到这样的要求:A文件夹中放有ABC.EXE和
Rem =============================================
Rem 文件名:CreateShortCut2Desktop.vbs
Rem 添加程序、文件夹、网站的快捷方式到桌面的示例小程序
Rem =============================================
Rem 初始化
set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
Rem 添加 ABC.exe 的快捷方式到桌面
set oShellLink = WshShell.CreateShortcut(strDesktop & "\ABC.lnk")
Rem oShellLink.TargetPath = WScript.ScriptFullName
oShellLink.TargetPath =Left(WScript.ScriptFullName,InStrRev(WScript.ScriptFullName,"\")) & "ABC.exe"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = ""
oShellLink.IconLocation = Left(WScript.ScriptFullName,InStrRev(WScript.ScriptFullName,"\")) & "ABC.exe, 0"
oShellLink.Description = "ABC"
oShellLink.WorkingDirector