Go Back   TechArena Community > Technology > Networking & Security
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , ,

Sponsored Links



Need a batch script to map drive

Networking & Security


Reply
 
Thread Tools Search this Thread
  #1  
Old 06-07-2009
Member
 
Join Date: Jun 2009
Posts: 4,013
Need a batch script to map drive

The title is all what i need here. I want to create batch script to map network drives for users at logon. At present i use to connect to a server via telnet and to map the drive i run the net use command.

If you guys have idea of doing the same, please let me know soon. help will be appreciated.
Reply With Quote
  #2  
Old 06-07-2009
Spyrus's Avatar
Member
 
Join Date: May 2008
Posts: 3,470
Re: Need a batch script to map drive

Copy this code and save it as batch file or simply add this to your logon script.Here it is :
Quote:
@echo off
net use G: /delete
net use G: \\server\share
Replace G with your desired drive letter. Here the first net code will delete any connection that is using the drive letter and the second net code will share or map the drive G.
Reply With Quote
  #3  
Old 06-07-2009
Member
 
Join Date: Feb 2009
Posts: 568
Re: Need a batch script to map drive

Quote:
Rem Default SBS Login Script for users
\\sbs1\netlogon\%username%.BAT
Or else you could add a batch file to the startup folder.You need to map the drive in this batch file:

Quote:
net use Z: \\servername\sharename
Or

Quote:
net use Z: \\servername\sharename password /user:username
to add credentials.
Reply With Quote
  #4  
Old 06-07-2009
Member
 
Join Date: Feb 2009
Posts: 145
Re: Need a batch script to map drive

You can get that by using dos command net. you will simply get the help page by typing net help use.

To map G drive to the server:

Quote:
net use w: \\server\sharefolder password /USER:domain\username
Once done, use copy command files. Thats it !!!
Reply With Quote
Reply

  TechArena Community > Technology > Networking & Security


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Need a batch script to map drive"
Thread Thread Starter Forum Replies Last Post
Batch Script to Convert PNG to XPM BRIGHID Operating Systems 3 22-08-2010 04:25 AM
Encrypt batch script content Aaliya Seth Software Development 4 01-04-2010 02:10 PM
Batch script to delete directory Logan 2 Software Development 4 01-04-2010 01:31 PM
Batch script to move users to different OUs Serrix Active Directory 6 23-12-2008 06:45 PM
Several. Msc window from a batch / script call? Stephanatic Technology & Internet 2 26-11-2008 05:26 PM


All times are GMT +5.5. The time now is 06:46 AM.