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

maping drive shortcut with variables

Status
Not open for further replies.

gmcjimmyguy

Technical User
Aug 8, 2002
2
US
I am trying to set up a shortcut to either a script, batch, or a command line that will allow the user to input the drive letter to be used and the network address of the resource to be mapped... can anyone help??? all i can figure so far is doing it without the variables
 
Here's something crude that should work

@echo off
if "%1"=="" goto error
net use %1: \\%2
goto end
:error
@echo Enter drive letter followed by resource: (server\directory)
pause
:end
exit

Put it into a file called something.bat or .cmd. You need to run the command "something.bat X server\share". It will then mount x: to the share given. If the variables are missing, it will give an error and wait for acknowlegment before exiting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top