Question : Problem: SMS 2003 VBScript Deployment Issue

I am wanting to deploy a vbscript that will change a drive mapping location without changing the drive letter.  I have tested the script and it works.  When I create a SMS package I also create a program that runs cscript test.vbs.  It shows that it runs and installs fine with no errors, but the script doesn't actually run.  Is there something that I am missing in the package?  Any help would be appreciated.
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:
28:
Dim oNetwork, oDrive, iDrive, bKeepInProfile
Dim sDriveLetter, sOldPath, sNewPath
 
sDriveLetter = ""
sOldPath = "\\OLDPATH"
sNewPath = "\\NEWPATH
bKeepInProfile = True
 
Set oNetwork = CreateObject("WScript.Network") 
Set oDrive = oNetwork.EnumNetworkDrives
 
If oDrive.Count > 0 Then
	For iDrive = 1 to oDrive.Count - 1
		If UCase(oDrive.Item(iDrive)) = UCase(sOldPath) Then
			sDriveLetter = oDrive.Item(iDrive-1)
			oNetwork.RemoveNetworkDrive oDrive.Item(iDrive-1), True, True
		End If
	Next
Else
End If
 
If sDriveLetter <> "" Then
	oNetwork.MapNetworkDrive sDriveLetter, sNewPath, bKeepInProfile
Else
End If
 
Set oDrive = Nothing
Set oNetwork = Nothing
Open in New Window Select All

Answer : Problem: SMS 2003 VBScript Deployment Issue

In the package itself, you can either run programs under local system or the logged in user.  I'm guessing you want to run the package under the logged in user, as local system won't have access to network drives.

This is separate from the client access and network accounts.

Random Solutions  
 
programming4us programming4us