我正在尝试创建一个VB脚本来创建Microsoft Kodu图标,因为图标在使用系统帐户时通过Microsoft SCCM部署时不会创建(真正的痛苦)
我从一些朋友那里得到了一些建议,把文件夹创建任务分成两个步骤,一个是"微软研究",另一个是"Kodu游戏实验室",但我被困在第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 ResearchKodu Game LabBoku.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 ResearchKodu Game LabBokuPreBoot.exe"
myShortcut.WorkingDirectory = "C:Program Files (x86)RSA SecurityRSA Authentication Managerprog"
myShortcut.WindowStyle = 4
myShortcut.Description = "Launch Kodu Game Lab Configuration Utility"
myShortcut.Save()
问题在于那一行的括号。您有两个选项:
-
在该行删除(),因为您没有在该行设置变量。()不需要
-
将行改为
newFolder = Objfso.CreateFolder(AllProgramMenuKodu)