Hi
I'm trying to do a batch file to ask for input of a username then pass that input to the Net user command to find out info.
At the moment its coming back with all users on the domain rather than the input of the username. Any ideas, people?
Thanks
Phil
@Echo Off
set /P INPUT=uname:
net user /domain %uname%
pause
Getting username to pass to Net user command
Moderator: DosItHelp
Re: Getting username to pass to Net user command
You are definitely confusing your variable name with your prompt string.
Read the help for the SET command. The variable name is always to the left of the = symbol.
Read the help for the SET command. The variable name is always to the left of the = symbol.
-
- Posts: 2
- Joined: 08 May 2013 04:24
Re: Getting username to pass to Net user command
Squashman wrote:You are definitely confusing your variable name with your prompt string.
Read the help for the SET command. The variable name is always to the left of the = symbol.
It's just possible I may kiss you. Or buy you a beer. All working thank you
Re: Getting username to pass to Net user command
phil_jones wrote:Squashman wrote:You are definitely confusing your variable name with your prompt string.
Read the help for the SET command. The variable name is always to the left of the = symbol.
It's just possible I may kiss you. Or buy you a beer. All working thank you
Not me but maybe Foxidrive. Not sure if they do that down under.

Re: Getting username to pass to Net user command
Yes, we drink beer here. 
