Udden
asked on
Map \\Server\Users\User1 with %Username%
The senario looks as follow:
\\Server\Users\User1 has a file File.exe and a dir. Documents.
I want to Map \\Server\Users\User1 by writing Net Use H: \\Server\Users\%Username%
then h: looks:
H:\
-\Documents
-File.exe
and NOT
H:\User1\
-\Documents
-File.exe
How do I do??
Rickard
\\Server\Users\User1 has a file File.exe and a dir. Documents.
I want to Map \\Server\Users\User1 by writing Net Use H: \\Server\Users\%Username%
then h: looks:
H:\
-\Documents
-File.exe
and NOT
H:\User1\
-\Documents
-File.exe
How do I do??
Rickard
You can't. If you use \\servername\sharename\%us ername% then it will create a folder in that share with full control ntfs permissions for that person. If you use \\servername\%username% you will get the required results, but you must create the folder and share yourself.
If the clients are NT Workstation (not W95) you can use the SUBST command:
SUBST H: \\Server\Users\%Username%
SUBST H: \\Server\Users\%Username%
ASKER
Yes that work but you need a script!
/Rickard
/Rickard
ASKER
I don't want scripts!!
ASKER
Strange? It looks like I have 2 answers.
Thats how it become two "No Scripts".
Thats how it become two "No Scripts".
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
"There are third party administrative tools that may allow you to do this." What and where?
/R
/R
Have I understood your problem correctly ??
This is how I usually do this.
Create a New User Template. Under Profile, in the login script field type login.bat. In the Home directory choose connect drive letter H: to \\servername\%username%. H for Home Directory.
Now I create a batch file like the following:
@echo off
if %OS% == Windows_NT goto winnt
:win
rem used for windows 3.11, 95 or 98
net use f: \\servername\fdrive
net use g: \\servername\gdrive
net use h: /home
net use i: \\servername\users
goto end
:winnt
net use f: \\servername\fdrive
net use g: \\servername\gdrive
rem net use h: /home Windows NT Workstation or Server does this for you
net use i: \\servername\users
:end
Save batch file as login.bat.
copy the batch file to \winnt\system32\repl\scipt s\import
Now, I create a share name for that user the same as their user name(ex. User Name=JOHN, Share Name=JOHN) under the directory USERS which is shared as USERS.
Hope this helps.
Create a New User Template. Under Profile, in the login script field type login.bat. In the Home directory choose connect drive letter H: to \\servername\%username%. H for Home Directory.
Now I create a batch file like the following:
@echo off
if %OS% == Windows_NT goto winnt
:win
rem used for windows 3.11, 95 or 98
net use f: \\servername\fdrive
net use g: \\servername\gdrive
net use h: /home
net use i: \\servername\users
goto end
:winnt
net use f: \\servername\fdrive
net use g: \\servername\gdrive
rem net use h: /home Windows NT Workstation or Server does this for you
net use i: \\servername\users
:end
Save batch file as login.bat.
copy the batch file to \winnt\system32\repl\scipt
Now, I create a share name for that user the same as their user name(ex. User Name=JOHN, Share Name=JOHN) under the directory USERS which is shared as USERS.
Hope this helps.
ASKER
No. You have to share all the users directory! If you have 120 users it becomes timeconsumming!
But I like the script, it gave me one idé.
/Rickard
But I like the script, it gave me one idé.
/Rickard
But the answer you accepted had you share a driectory too. Using his way you cannot even use %username% when creating a new user. Did you implement his answer?
It's working as designed.
If you want to go up another level, the only way is to type NET USE H: \\SERVER1\USERS then CD into the directory you want.
However, you could put this in your logon script :
NET USE H: \\SERVER1\USERS
CD H:\%USERNAME%
..or put another level in your directory sructure - ie \\SERVER1\USERS\User1\User
Tim