Jump to content

Map local drive/subst command in VBS script?


Recommended Posts

Posted

Hi,

 

I need to map a drive letter to a local path on the computer. For example, Z: drive points to c:\very\long\path.

 

I can do this using the subst command but I need a way to do it using my vbs logon script.

 

If anyone can help at all I would very much appreciate it.

 

Thanks.

Posted

Dim objShell, strDrive, strPath

Set objShell = CreateObject("WScript.Shell")

strDrive = "Z:"

strPath = """c:\very\long\path"""

objShell.Run "cmd /c SUBST " & strDrive & " " & strPath, 1, True

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...