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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to write a batch file (have no idea how)

Status
Not open for further replies.

hppsf

Technical User
Aug 28, 2001
14
0
0
US
I have installed software that resides on our server and needs to be accessed by all users. When I mapped the drives on the local computers as administrator it works. When I log in as a user I am unable to view the "shared resources".

I need to have all users have their m drive mapped to a folder on our server. How can I do this? I have been told that I need to write a batch file. How do I do that?

Thanks for any suggestions,
 
Stick this in a vbs script and use it as a login script. firstly make sure you have the share on the server with all the right access levels so the people who are mapping have access.


On Error Resume Next
Set WshNetwork = CreateObject("Wscript.Network")
WshNetwork.MapNetworkDrive "M:", "\\server\share"


You can add other drives if you want, just edit the server and share bit to match your network setup

 
open up notepad.. If you don't know where notepad is located, go to start, run, and type in notepad. Once you are in the notepad file type in the following exactly as appeared...

echo off

-REM Mapps the "M" drive for the employee
net use M: \\servername\share

echo on

Echo off means that the person who's using the script will not see the server name or any coding behind what is being mapped or done to their computer. -REM is a placeholder where you can put a message for further network admins to see what is going wrong with the script if there ever is a problem. You can do as many -REM's and everything that you ever need to do. I would strongly recommend to use echo off and echo on for security purposes.

If you need more than one thing mapped, here is what the batch file would look like

echo off
-REM Mapps the "M" drive for the employee personal folder
net use M: \\servername\share

-REM Mapps the "D" drive for accounting software "Money"
net use l: \\servername\share
echo on


In order to save the batch file, go to file, save as. Find the location where you want to save the .batch file first. Once that is done, type in the filename for the batch file followed by .bat
so if my filename was to be employee, the complete string under save as would look like employee.bat

If you have any other questions, just ask.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top