我正在尝试创建一个 VB 脚本来为 Microsoft Kodu 创建图标,因为在使用系统帐户时通过 Microsoft SCCM 部署时不会创建图标(真的很痛苦。)
我从一些朋友那里得到了一些关于将文件夹创建任务分为两个步骤的建议,一个用于“Microsoft Research”,另一个用于“Kodu Game Lab”,但我卡在第 19 行,字符 2 - 我猜我是犯了一个经典的 n00b 错误,因为我对脚本还很陌生!
有什么建议么?这是我的脚本:
Dim shell, Objfso, allStartMenu, myShortcut, allProgramMenuMR, allProgramMenuKodu
Set Objfso = CreateObject("Scripting.FileSystemObject")
Set shell = WScript.CreateObject("WScript.Shell")
'Tells script how to get to All Users Start Menu
allProgramMenu = shell.SpecialFolders("AllUsersPrograms")
'Tells script to check if Microsoft Research start menu folder exists and creates it if necessary.
allProgramMenuMR = allProgramMenu + "\\Microsoft Research"
if not Objfso.FolderExists (allProgramMenuMR) Then
Objfso.CreateFolder (allProgramMenuMR)
End If
'Tells script to check if Kodu Game Lab start menu folder exists and creates it if necessary.
allProgramMenuKodu = allProgramMenu + allProgramMenuMR + "\\Kodu Game Lab"
if not Objfso.FolderExists (allProgramMenuKodu) Then
Objfso.CreateFolder (allProgramMenuKodu)
End If
' Create Kodu Game Lab shortcut
Set myShortcut = shell.CreateShortcut(allProgramMenuKodu + allProgramMenuMR + "\\Kodu Game Lab.lnk")
myShortcut.TargetPath = "C:\Program Files (x86)\Microsoft Research\Kodu Game Lab\Boku.exe"
myShortcut.Arguments = "/NoUpdate /NoInstrumentation"
myShortcut.WorkingDirectory = ""
myShortcut.WindowStyle = 4
myShortcut.Description = "Launch Kodu Game Lab."
myShortcut.Save()
' Create Configure Kodu Game Lab shortcut
Set myShortcut = shell.CreateShortcut(allProgramMenuKodu + allProgramMenuMR + "\\Configure Kodu Game Lab.lnk")
myShortcut.TargetPath = "C:\Program Files (x86)\Microsoft Research\Kodu Game Lab\BokuPreBoot.exe"
myShortcut.WorkingDirectory = "C:\Program Files (x86)\RSA Security\RSA Authentication Manager\prog\"
myShortcut.WindowStyle = 4
myShortcut.Description = "Launch Kodu Game Lab Configuration Utility"
myShortcut.Save()