Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Logon script to map network drives

Posted on 2003-10-29
15
Medium Priority
?
110,553 Views
Last Modified: 2012-05-04
Hi

I am trying to setup a logon script so a when a user log's on he will have 5 mapped network drives.  When I googled on how to do this it seems like I need to setup a batch file first.  I know very little about creating batch files, I tried creating one:

***********LOGON SCRIPT***********
net use g: /d
net use h: /d
net use i: /d
net use j: /d
net use k: /d
net use l: /d

net use g: //servername/folder
net use h: //servername/folder
net use i: //servername/folder
net use j: //servername/folder
net use k: //servername/folder
net use l: //servername/folder

I saved this as map.bat, when I ran it on the local machine it worked fine.  However I am unsure on how to get the batch file to run when the user log's on. I tried placing the map.bat file in %SYSTEMROOT%\SYSVOL\domain name\SCRIPTS.  I tried going into user profile, and specifing the logon script as C:\WINNT\SYSVOL\sysvol\DomainName\scripts\map.bat, but that did not work.   I was just wondering could anyboday tell me how to get the batch file to run when the user log's in.

Thxs
Gareth
0
Comment
Question by:garethcummings
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 2
  • +3
15 Comments
 
LVL 32

Assisted Solution

by:LucF
LucF earned 80 total points
ID: 9641257
http://www.jsiinc.com/SUBG/TIP3300/rh3341.htm

Create a logon script, Logon.bat, and place it in the NETLOGON share on the domain controller. The default location of the NETLOGON share is C:\WINNT\SYSVOL\sysvol\<Domain Name>\scripts.

Hope this helps

LucF
0
 
LVL 32

Expert Comment

by:LucF
ID: 9641265
Make sure this folder is shared as NETLOGON and that your logon script is called "logon.bat"
0
 
LVL 13

Accepted Solution

by:
ocon827679 earned 140 total points
ID: 9641405
In the user profile settings, don't list the C:\...  Just input the name of the script, logon.bat.  The system knows the location of the Netlogon share and will look there for the bat file.  When you placed the C:\... you specified that the logon script is on the local computer, whereas you want it on the domain controller.
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 15

Expert Comment

by:Rob Stone
ID: 9641509
If your machines are 2000 then you can create a GPO and then just browse to the script in there.

Computer Config > Windows Settings > Scripts > Startup - add the file in here, apply the GPO to the OU.
0
 
LVL 32

Expert Comment

by:LucF
ID: 9641553
ocon827679
I said:
=> and place it in the NETLOGON share on the domain controller. <=
I think you misread my post. But thanQ for looking out.
0
 
LVL 13

Expert Comment

by:ocon827679
ID: 9641667
LucF,
No I didn't misread your quote.  Look at garehcummings statement.  He placed the path of the bat file as C:\... in the users profile for the login script.  He doesn't want to do that.  Just place the name of the script there.  What I should have added was to follow your steps in where to place the physical file.  
0
 

Author Comment

by:garethcummings
ID: 9641727
ocon827679, thanks very much that worked a treat, just one last thing, does anyone know of any good sites where I can get some more batch commands, I want to add a few in to the batch file such as mapping the printers, forcing user to update AV etc.
thks
Gareth
0
 
LVL 13

Expert Comment

by:ocon827679
ID: 9641747
You ought to look at using kixstart. (www.kixstart.org)  It's on the installation media and there is a doc there that tells you how to use it.  It allows much greater flexibility than what you are trying to use and it's fairly easy to understand and utilize.
0
 
LVL 32

Expert Comment

by:LucF
ID: 9641753
For mapping the printers..

net use lpt1: //servername/sharename

for updating the virusscanner, I should first know what kind of virusscanner you're using, but I think it would be easier to just set them all to automatically update.

LucF
0
 
LVL 32

Expert Comment

by:LucF
ID: 9641759
you can also take a look at => http://windows.about.com/cs/batchscriptingtips/
0
 

Author Comment

by:garethcummings
ID: 9641903
thxs for the tips, there should be enough to keep me goign for a while
0
 
LVL 32

Expert Comment

by:LucF
ID: 9641974
ThanQ
0
 

Expert Comment

by:nurdi_lim
ID: 10307161
i think u can put the scripts in netlogon
and put the script in each local computer at the startup and the scripts is link to //servername/netlogon/login.bat
but u must share the net logon folder first

thanks
0
 

Expert Comment

by:redlineconsulting
ID: 11889147
what does the /d option do at the end of net use... does it clear out current mappings?
0
 
LVL 32

Expert Comment

by:LucF
ID: 11889959
Normally you should ask your own question and not ask your question in another persons question as it's kind of rude, but in this case I'm sure you allready know the answer yourself which is: Yes, it clears the mapping.
For the fun of it, go to a command prompt (win2k/winXP: start => run => "CMD") and there type "Net use /?" (without the quotes) and press enter to see the net use options.

LucF
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Check out what's been happening in the Experts Exchange community.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

705 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