|
Answer» Well i need help im trying to make a batch file that gets the ip address and sets it as an input for a friend because he doesnt have a static ip and he hates changeing the ip address daily of the application he has. i ALREADY KNOW how to get it into the app but for some reason i cant FIND out how to set the ip address as an input here is what i have already done and thats all i need because i can get the rest.
@echo off ping.exe -n 1 -i 1 -w 1 www.microsoft.com arp.exe -a | find "Interface" pause
this doesnt seem like much but that is all i have for this PART off it i accually have a lot more than this please help o and the pause was because i needed it to test ito and for some reason i can get the harder stuff but not the SIMLE lol I'm confused what is the use of this ... ?
I understand needing the IP address, but what do you need it for? What program ...
The way you word this seems fishy. Maybe i'm wrong. my friend needs it i think for a garrys mod serverheres the rest of the code and yah its a gmod server
@echo off color 04 title ECHO SRDS PROTECTOR set tempfile=servercheck.txt
echo What time would you like ECHO to restart your server? echo please put in this format if pm 19:05:29.92 if am 3:26:28.02!!! set input= set /p input=TIME?: cls :run echo ECHO is protecting srcds from crashes... You have the auto restart time set to %input%. echo at (%time%) on (%date%) srcds has started. start srcds.exe -console -game garrysmod +map gm_flatgrass +maxplayers 16 +hostport 27015 +tv_port 27020 +ip "%ip%" goto time
:time if %time% equ %input% goto restart
:serverchecker tasklist > %tempfile% type %tempfile% | find /i "srcds.exe" if errorlevel 0 if not errorlevel 1 goto time
:crash taskkill /im srcds.exe echo SRCDS has crashed or has been closed on %date% at %time%! echo RESTART. goto run
:restart echo srcds has restarted on %date% at %time%. taskkill /im srcds.exe goto run
|