Discussion Locked

Environment variable..

0 helpful
10 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I would like to map a home directory for users using logon scripts. However, I want to use the %username% variable. How can I set this variable to be equal to the username used during logon on a Windows9x box? Basically, I am just trying to map the users' home dir to ONLY their share. Right now everybody can see all the other users' directories and must browse to their own (since I used Usrmgr to map h: to \\servername\home\%username%).

Thanks,
Kurt

10 replies

by calves

I tought you're already had the answer, from last time you posted it.
Since the first answer didn't work, I'll just follow up for the right answer.

by kurt g

Well Calves, I appreciate your help. But, your answer wasn't the answer to my question. I STILL can't seem to find a way to map ONLY to the user's home dir?????

by guy

Try the SUBST (substitute command)
SUBST can subsitute a drive letter for the \\server\home\%username%
Example
When a user logs on, a script (UsrLogon.cmd) will be run that maps a drive letter to their home directory using the “subst”command. For example, Z:\ will map to \\server\users\fredf for Fred Flounder and to \\server\users\barneyb for Barney Baitfish.

by kurt g

I guess I don't understand how using SUBST will help here? This is the second time I've gotten that answer. I'll have to look into this more... Thanks.

by waifoon

If you do not wish to let other users browse the other users' directories, perhaps you can hide them by putting the "$" when you indicate you want to share this particular directory, so for eg, if you created a directory called Kurt, when you specify the share name, just put kurt$. Then map your username to that hidden directory.

by mwb

OK, so Win9x cannot interpret %USERNAME% so wherever you try to use it you get a null value. That is why it maps to \\servername\home. As a matter of security, if you are sharing out each user directory you should use the "$" at the end of the share name but you won't be able to get Win9x to map directly there without a hardcoded script. For my few 9x machines I create c:\maphome.bat with net use h: \\servername\actualusername$ in it. In the login script i use: "if exist c:\maphome.bat callc:\maphome.bat" I wouldn't want to use it for 100 PC's but it works for a few if the same user always uses the same PC.

This discussion is closed to new replies.