CMD.exe batch for net use
- From: Richhall <rje.hall@xxxxxxxxxxx>
- Date: Wed, 21 May 2008 08:18:30 -0700 (PDT)
Apologies if I should be using msdos batch group. I am using Widnows
XP and had a simple batch that had 3 variables at the prompt to create
a net use connection:
net use u: /d
rem *****************************************
rem %1 is IP address of target
rem %2 is username
rem %3 is password
rem -----------------------------------------
net use u: \\%1\c$ %3 /user:DOMAIN\%2 /PERSISTENT:NO
pause
However I want this to be run from a file not the command line. I've
searched the group but can's see it without using 3rd party software
how I can prompt for the %1 etc. I am not exactly sure what I am
doing, but got this far:
set /p IP=Enter Target IP:
set /p User=Username:
set /p Pass=Password:
echo %IP%
echo %User%
echo %Pass%
net use u: /d
rem *****************************************
rem %1 is IP address of target
rem %2 is username
rem %3 is password
rem -----------------------------------------
net use u: \\%1\c$ %3 /user:DOMAIN\%2 /PERSISTENT:NO
pause
How do I set the values entered in, as the %1, %2 and %3 values please?
.
- Follow-Ups:
- Re: CMD.exe batch for net use
- From: Pegasus \(MVP\)
- Re: CMD.exe batch for net use
- Prev by Date: Re: Adobe Acrobat 8.0
- Next by Date: Re: same USB printers cause new hardware detection
- Previous by thread: Re: Adobe Acrobat 8.0
- Next by thread: Re: CMD.exe batch for net use
- Index(es):
Relevant Pages
|