给U盘里的程序创建桌面快捷方式
来源:百度知道 编辑:UC知道 时间:2024/06/04 16:37:05
跟1、2 楼的筒靴 意见严重一致, 咋要 搞的这么 麻烦勒。。。。。。
但,既然 选择回复你, 那当然就要就问题 论问题咯。
vbs 文件内容如下:
————————————
Dim fso, SubDrives, i, DrivePath
Set fso = CreateObject("Scripting.FileSystemObject")
Set SubDrives = fso.Drives
For Each i In SubDrives
DrivePath = i.DriveLetter
If fso.GetDrive(DrivePath & ":").DriveType = 1 Then :'1为可移动磁盘类型
Set WshShell = WScript.CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop") :'在桌面创建一个快捷方式
set oShellLink = WshShell.CreateShortcut(strDesktop & "\2.lnk")
oShellLink.TargetPath = DrivePath & ":\XXX..XXX\2.exe" :'目标
oShellLink.WindowStyle = 1 :'参数1默认窗口激活,参数3最大化激活,参数7最小化
oShellLink.IconLocation = DrivePath & ":\XXX..XXX\2.exe, 0"
oShellLink.WorkingDirectory = DrivePath & ":\XXX..XXX\2.exe