[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


SMS 2003 VBScript Deployment Issue

Posted on 2009-04-28
Medium Priority
Last Modified: 2013-11-21
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.
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
End If
If sDriveLetter <> "" Then
	oNetwork.MapNetworkDrive sDriveLetter, sNewPath, bKeepInProfile
End If
Set oDrive = Nothing
Set oNetwork = Nothing

Open in new window

Question by:baguthrie
  • 2
  • 2
LVL 22

Expert Comment

by:Adam Leinss
ID: 24253782
Under what account are you running the package, is it SYSTEM or user privileges?

Author Comment

ID: 24253835
I have it running under a service account that we have created and it is a local admin on the box.  I know the account itself has the privileges because we have distributed packages before.
LVL 22

Accepted Solution

Adam Leinss earned 2000 total points
ID: 24254893
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.

Author Comment

ID: 24260541
thanks for your help.  that was it.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
It is a real story and is one of my scariest tech experiences. Most users think that IT experts like us know how to fix all computer problems. However, if there is a time constraint and you MUST not fail the task or you will lose your job, a simple …
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question