Scripts Thread, Map local drive/subst command in VBS script? in Coding and Web Development; Hi,
I need to map a drive letter to a local path on the computer. For example, Z: drive points ...
14th December 2012, 01:53 PM #1
- Rep Power
Map local drive/subst command in VBS script?
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.
14th December 2012, 03:25 PM #2
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
14th December 2012, 04:28 PM #3
- Rep Power
Thanks for your reply. I've left work now so will give this a try on Monday!
By cookie_monster in forum Coding
Last Post: 22nd April 2013, 09:04 AM
By sarchs in forum Windows Server 2000/2003
Last Post: 11th May 2011, 06:02 PM
By Bruce123 in forum Windows
Last Post: 20th September 2009, 01:22 PM
By Pyroman in forum How do you do....it?
Last Post: 11th June 2008, 04:19 PM
By timbo343 in forum Windows
Last Post: 7th December 2005, 09:09 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)