Jump to content

Help...batch script to map network drive


Recommended Posts

Posted

I have a common PC(winXP pro) which have not join to the Domain.

This PC is under workgroup and login by a local account, everyone can use it.

Now, since security reason, I would like to have a batch file to map a network drive(share folder in file server) by their own domain user account when they use this PC. i.e. User A use this PC, user A use his account and password to map the network drive, and disconnect after used(automatic disconnect after 30mins or disconnect by another script file)

Appreciate if anyone can help. Thanks in advanced.


Posted

is everyone using the same local account to log onto the computer? If so you will need to prompt for the users domain account and password in your script.

Posted

Hi Yukiyau,

You could add a batch file to the startup folder, for that user only. In the batch file map the drive -

"net use Z: \\servername\sharename"

or to add credentials -

"net use Z: \\servername\sharename password /user:username"

to clear the map drive -

"net use Z: /d"

Hope that helps.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...