+ Post New Thread
Results 1 to 3 of 3
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 ...
  1. #1

    Join Date
    Jul 2010
    Posts
    52
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Map local drive/subst command in VBS script?

    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.

  2. #2

    Join Date
    Feb 2009
    Posts
    136
    Thank Post
    0
    Thanked 33 Times in 32 Posts
    Rep Power
    16
    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

  3. #3

    Join Date
    Jul 2010
    Posts
    52
    Thank Post
    4
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks for your reply. I've left work now so will give this a try on Monday!

SHARE:
+ Post New Thread

Similar Threads

  1. Pass a program variable in VB Script?
    By cookie_monster in forum Coding
    Replies: 21
    Last Post: 22nd April 2013, 08:04 AM
  2. Mapped network drives not showing in My Computer
    By sarchs in forum Windows Server 2000/2003
    Replies: 8
    Last Post: 11th May 2011, 05:02 PM
  3. Drive mapping issues in logon scripts
    By Bruce123 in forum Windows
    Replies: 10
    Last Post: 20th September 2009, 12:22 PM
  4. Mapping local drives (not network drives)
    By Pyroman in forum How do you do....it?
    Replies: 4
    Last Post: 11th June 2008, 03:19 PM
  5. Replies: 4
    Last Post: 7th December 2005, 08:09 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •