Solved

Map \\Server\Users\User1 with %Username%

Posted on 1998-12-01
12
1,099 Views
Last Modified: 2013-12-19
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
0
Comment
Question by:Udden
  • 5
  • 2
  • 2
  • +3
12 Comments
 
LVL 23

Expert Comment

by:Tim Holman
ID: 1566489
Udden,
  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\User1.

Tim
0
 
LVL 1

Expert Comment

by:bphillips
ID: 1566490
You can't.  If you use \\servername\sharename\%username% 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.
0
 
LVL 5

Expert Comment

by:carmine
ID: 1566491
If the clients are NT Workstation (not W95) you can use the SUBST command:

SUBST H: \\Server\Users\%Username%
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:Udden
ID: 1566492
Yes that work but you need a script!
/Rickard
0
 

Author Comment

by:Udden
ID: 1566493
I don't want scripts!!
0
 

Author Comment

by:Udden
ID: 1566494
Strange? It looks like I have 2 answers.
Thats how it become two "No Scripts".

0
 
LVL 2

Accepted Solution

by:
mbreuker earned 200 total points
ID: 1566495
Here is another option for you:

Share each users directory as a "hidden" share. To make it hidden, just add a $ sign at the end of the share name. For instance, to share \\<servername>\users\bob, you would name the share BOB$. Then you can type map H: \\<servername>\BOB$.

Of course this is a lot of administrative overhead if you need to do this for more than a handful of users. The "Microsoft solution" is to use the SUBST command, which only produces the desired result if the user is running NT workstation.

Sorry, the "net use <driveletter>" command is not as robust as Novell's "map" command. Maybe this will change soon. There are third party administrative tools that may allow you to do this. You are certainly not the first person to ask this question and it is actually a fairly common request on this thread.

0
 

Author Comment

by:Udden
ID: 1566496
"There are third party administrative tools that may allow you to do this." What and where?
/R
0
 
LVL 23

Expert Comment

by:Tim Holman
ID: 1566497
Have I understood your problem correctly ??

0
 

Expert Comment

by:sdczerno
ID: 1566498
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\scipts\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.
0
 

Author Comment

by:Udden
ID: 1566499
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
0
 

Expert Comment

by:sdczerno
ID: 1566500
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?
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever set up your wireless router at home or in the office to find that you little pop-up bubble in the bottom right-hand corner of Windows read "IP Conflict - One of more computers on the network have been assigned the following IP address"…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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