Jump to content

Command prompt help


noble_aloof

Recommended Posts

i'm running xp. im trying to create a simple file to ping my router.

 

 

 

what i need to do:

 

have the user define a variable

 

have this variable work

 

 

 

heres what i have so far

 

 

@echo off

 

title testing network

 

echo please enter ip adress

 

rem this is where the user of the batch file should set the varible %ip%

 

(i have no idea how to get the user to input a variable)

 

pause

 

pinging %ip%

 

ping %ip% -w 1

 

echo done

 

pause

 

exit

 

 

 

 

i've looked all over online.. i cannot figure this out. please help

[size="5"][font="Georgia"][b]Staking:[/b][/font][font="Palatino Linotype"][color="#FF0000"][/color][color="#FFFF00"][/color][color="#00FF00"] 4+ mil[/color][/font]
[font="Georgia"][b]Current Status:[/b][/font][font="Palatino Linotype"][color="#FF0000"][/color][color="#0000FF"] Training defense [/color][/font][/size]
Link to comment
Share on other sites

Try something like this:

 

@echo off

title Testing Network

echo Please enter IP address...

SET /P IP=[iP]

pause

echo Pinging %ip%...

ping %ip% -w 1

echo Done

pause

exit

Link to comment
Share on other sites

thank you very much. this should help with other things aswell.

[size="5"][font="Georgia"][b]Staking:[/b][/font][font="Palatino Linotype"][color="#FF0000"][/color][color="#FFFF00"][/color][color="#00FF00"] 4+ mil[/color][/font]
[font="Georgia"][b]Current Status:[/b][/font][font="Palatino Linotype"][color="#FF0000"][/color][color="#0000FF"] Training defense [/color][/font][/size]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.