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!

map network drive for all users 1

Status
Not open for further replies.

jfc1003

IS-IT--Management
May 2, 2002
146
0
0
US
How do I map a network drive so that all users of a computer have that drive when they log on?

I have an application that will not work if a drive is not mapped to a network share on the server. Everytime a new user logs on to the machine, I have to go map the drive for them again.
 
For all users, create a batch file in your NETLOGON (which is c:\<windir>\sysvol\sysvol\<domain>\scripts on our server) share on your server with the line:

net use x: \\server\share

Then change the logon script to this batch filename in each of your users, in Active Directory Users and Computers, double click each user, click the Profile tab.

I used this for common mapping between all departments, then OU's for mappings specific to each department.

Daniel.
 
If they don't log on to a domain (thus you don't have the logon script that executes) you can just place that batch file inside the startup group and it'll run at startup (preferably in the All users startup group).
 
To make sure I understand, this &quot;net use&quot; command would be temporary, correct? Does it only take effect at each logon and end at each logoff?

Or in other words, if I remove the script from the user at a later time, the share will stop appearing in the &quot;My Computer&quot; window?

By the way, thanks!!!!!
 
Well, by default &quot;net use&quot; commands are remembered. However, you can change this with:

NET USE /PERSISTENT:ON
(Changes are remembered after logoff)

NET USE /PERSISTENT:OFF
(Changed are NOT remembered after logoff)

Just insert the appropriate command before you map any drives.

e.g.
REM Batch file script begin (discard network mapping after logoff)
NET USE /PERSISTENT:OFF
NET USE X: \\<server>\<share>
REM Batch file script end

If you are not sure if it will remember it or not, type
NET USE

with no parameters, and the first line will indicate whether they are remembered or not.

BTW, you can map printers using NET USE as well. This can be handy if you have a workgroup printer set up.

Daniel.
 
Sorry, correction:

the correct switches for /persistent are
YES and NO.

so, NET USE /PERSISTENT:YES *remembers network mappings
NET USE /PERSISTENT:NO *discards network mappings

(The train of thought derailed once again :) )

Daniel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top