Question : Problem: Distributing vbs files through sms 2003

I have a *.vbs file that updates shortcuts on the w2k Desktop and favourites with new URL.  This works okay when run from the server location.  However when I create and advertise the package in SMS.  The script does not apply, SMS reports say succssful.  I have tried an exe version of the same file.  Same result.  I have also tried wscript in the SMS command line.  I have created various SMS packages in the past however I have never been successful with a vbs or bat file.  Please assist.  
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
on error resume next
Set oShell = CreateObject("WScript.Shell")
set oFso = CreateObject("Scripting.FilesystemObject")
 
sPath = oShell.SpecialFolders("Desktop")
ChkLnk(sPath)
 
sPath = oShell.SpecialFolders("AllUsersDesktop")
ChkLnk(sPath)
 
sPath = oShell.SpecialFolders("Favorites")
ChkLnk(sPath)
 
Sub ChkLnk (sFolder)
  Set oFolder = oFso.GetFolder(sFolder)
  Set oFiles = oFolder.Files
 
  For Each oFile In oFiles
    If LCase(oFso.GetExtensionName(oFile)) = "url" Then
      Set oLnk = oShell.CreateShortcut(oFile)
      If InStr(LCase(oLnk.TargetPath),"ausysrohan/infraenterprise/infraenterprise") > 0 Then
        oLnk.TargetPath = Replace(LCase(oLnk.TargetPath),"ausysrohan","ausysinfisp01")
        oLnk.Save
      End If
    End If
  Next
End Sub
Open in New Window Select All

Answer : Problem: Distributing vbs files through sms 2003

have you defined the oShell object?
set oShell = CreateObject("Wscript.Shell")

Also debug with Msgbox function directly on a pc if the sPath is filled correctly!
Random Solutions  
 
programming4us programming4us