Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login script to map folders for users log in?

Status
Not open for further replies.

rahmanjan

Programmer
Apr 13, 2003
180
0
0
AU
hi guys,

is windows XP allowing to write down log in script to map folders for specific users based on log in.

any resourcs?
any hint will be appreciated

TA
RA
 
Rahmanjan,

Yes, you can run a script in Windows XP to map shares at logon. You can even write it so it maps selective shares, based upon user name.

There are plenty of ways to do this. How about some specifics as to what you have, and what you need?

Is this XP Pro on a domain, or is this a workgroup? How many different computers? How many different users? How many different shares, how many shares / user, how many shares are shared by more than one user?

Writing scripts (in MS-Batch language) isn't hard. Making them work right is a challenge sometimes.

Cheers,

Chuck

Paranoia is not necessarily a bad thing - it's a normal response to experience.
 
Hi Chuck,

thanks for the reply.

it is just a home network basically 4 pcs connected together with a work group
and a hub. I am just trying to practice these stuff ...

there will be just admin and 2 extra users in this pc. i just want to do it in
this work statation. about sharing? i just want to share couple of folders and
MS Office Stuff and internet.

TA

RA
 
Rahmanjan,

OK, 1 computer, 3 users? Easy.

Create a file, say MapShares.cmd, one version for each of the 3 users. Put a shortcut to MapShares.cmd into the Startup list for each individual user.

Each version of MapShares contains a list of folders:

###

net use j: \\server1\share1
net use k: \\server2\share2a
net use l: \\server2\share2b

###

Or you could have 1 file with all 3 possibilities, in the common Startup list. Interrogate the environment variable %UserName% to decide what set of mappings to do.

Or you could be fancy, and have MapShares read a control file, say MapShares.ctl.

###

User1 \\Server1\Share1
User1 \\Server2\Share2a
User2 \\Server1\Share1
User2 \\Server2\Share2b

###

Match each line against %UserName%.

Use your imagination, and have fun. Writing a Windows Batch script to read an external file is really a pain the first time, but it's fun afterwards.

Cheers,

Chuck

Paranoia is not necessarily a bad thing - it's a normal response to experience.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top