vbscript for mapping network shares

Posted on 2011-10-12
Last Modified: 2012-05-12
Hello, I am completely new to vbscripting. Currently we have batch files connecting to network shares using the NET USE command simmilar to this

net use H: /delete /y
net use H: \\server01\%username%

What could i use in vbs that would do the same function %username% does?

Thank you for your help!
Question by:mscit
    LVL 5

    Accepted Solution

    .MapNetworkDrive "H:", "\\server01\" & .UserName

    There is a good article here mapping the same drives but with different methods such as batch , vbs etc

    Author Closing Comment

    Thanks So Much, this really helped me out.

    Great link

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Welcome to part one of a multi-part tutorial series, VBScript for Windows System Administrators.  The goal of this series is to teach non-programmers how to write useful VBS code to automate their environment, and perform tasks faster, and in a more…
    I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now