I have a Script Bach files that I run for getting information form PCs.
Some of how it all works in the BATCH file looks like this:
echo MENU OPTIONS :
echo 1 PING
echo 2 TRACERT
echo Q - Quit
set /p input="Enter Options Here: "
if "%input%"=="1" goto ING
if "%input%"=="2" goto:TRACERT
if "%input%"=="q" goto:exit
echo Please choose from the Options listed above!
set /p host="Enter Host to ping: "
set /p host="Enter Host to tracert: "
Ok now here is my issue!
With the above setup, at each entry I have to enter in the IP or Host name of the PC over and over.
Is it possible to switch it so that I get asked the IP or Hostname once and then be able to run "all" the commands in the menu from that single entry?
I guess I need an example to:
1 - Enter the IP/Host address
set /p input="What is the Host of the PC your working on?:"
2 - GOTO for each command to use the IP address that I just entered.
3 - I know I can close the Batch file to reset it, however is it possible to have a RESET option in the menu so that I can enter in the next IP/Host address?
Any help that you can throw my way would be great. Thank you
No Honestly! It's not really.
I work at a IT Help Desk at a local bank and I haven't played around with scripts for almost 20 years.
I not sure if one can get the initial IP to be used for all the commends and especially having someway to reset it for the next IP address?