2014-07-06 2 views
0

시스템 계정을 사용할 때 Microsoft SCCM을 통해 배포 할 때 아이콘이 생성되지 않으므로 Microsoft Kodu 용 아이콘을 만드는 데 VB 스크립트를 만들려고합니다 (실제 고통).하위 폴더가있는 시작 메뉴 아이콘 만들기

일부 친구로부터 "Microsoft Research"와 "Kodu Game Lab"을위한 두 단계로 폴더 생성 작업을 분할하는 데 조언을 받았지만 19 행의 문자 2에 갇혀 있습니다. 내가 스크립팅을 처음 접했을 때 clasic 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() 

답변

0

문제는 해당 줄에 괄호가있는 것입니다. 다음과 같은 두 가지 옵션이 있습니다.

  1. 해당 줄에 변수를 설정하지 않았으므로()를 제거하십시오.()이 필요하지 않거나

  2. 변경 라인은 newFolder = Objfso.CreateFolder(AllProgramMenuKodu)

를 읽고