[BATCH] 'Ping' Command Not Working.

April 12, 2009 at 20:04:47
Specs: Windows Server 2003 - 64bit
Hello!
I've made a batch file, it works fine on my windows XP computer, but it's not working on my Windows Server 2003 computer, the 'Ping' command on it isn't working.

Here is it:

@echo off
Title Restarter
:start
color cf
echo Created by
PING 1.1.1.1 -n 1 -w 1 >NUL
cls
echo Created by C
PING 1.1.1.1 -n 1 -w 1 >NUL
cls
echo Created by Cr
PING 1.1.1.1 -n 1 -w 1 >NUL
cls
echo Created by Cru
PING 1.1.1.1 -n 1 -w 1 >NUL
cls
echo Created by Cruz
PING 1.1.1.1 -n 1 -w 1 >NUL
cls
echo Created by Cruze
PING 1.1.1.1 -n 1 -w 1 >NUL
cls
echo Created by Cruze
echo ----------------
PING 1.1.1.1 -n 1 -w 1 >NUL
echo 1. To restart the server every hour type 'Auto'.
echo 2. To restart the server type 'Restart'.
echo 3. To start server type 'Run'.
echo 4. To shutdown the server type 'Exit'.
echo 5. To shutdown this restarter type 'Close'.
echo ----------------
set /p c=Option:
if %c%==run goto run
if %c%==exit goto exit
if %c%==restart goto restart
if %c%==auto goto auto
if %c%==close goto close
:run
echo Starting 'launch_world.bat'
start launch_world.bat
echo Starting 'launch_login.bat'
start launch_login.bat
echo Starting 'launch_channel.bat'
start launch_channel.bat
echo 'Run' Complete
goto start
:exit
taskkill /f /im launch_world.bat
taskkill /f /im launch_login.bat
taskkill /f /im launch_channel.bat
cls
goto start
:restart
echo Restarting ...
taskkill /f /im launch_world.bat
taskkill /f /im launch_login.bat
taskkill /f /im launch_channel.bat
echo Starting 'launch_world.bat'
start launch_world.bat
echo Starting 'launch_login.bat
start launch_login.bat
echo Starting 'launch_channel.bat
start launch_channel.bat
echo Restart Complete
cls
goto start
:auto
echo restarting server in 60 minutes..
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 59 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 58 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 57 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 56 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 55 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 54 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 53 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 52 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 51 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 50 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 49 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 48 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 47 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 46 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 45 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 44 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 43 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 42 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 41 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 40 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 39 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 38 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 37 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 36 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 35 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 34 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 33 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 32 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 31 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 30 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 29 minutes.PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 28 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 27 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 26 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 25 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 24 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 23 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 22 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 21 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 20 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 19 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 18 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 17 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 16 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 15 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 14 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 13 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 12 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 11 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 10 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 9 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 8 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 7 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 6 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 5 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 4 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 3 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 2 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo restarting server in 1 minutes.
PING 1.1.1.1 -n 60 -w 60 >NUL
cls
echo Restarting ...
Killing server processes ...
taskkill /f /im launch_world.bat
taskkill /f /im launch_login.bat
taskkill /f /im launch_channel.bat
echo Starting 'launch_world.bat'
start launch_world.bat
echo Starting 'launch_login.bat
start launch_login.bat
echo Starting Channel.bat
start launch_channel.bat
echo Restart Complete.
Auto restart repeating.
cls
goto auto
:close
cls


See More: [BATCH] Ping Command Not Working.

Report •


#1
April 12, 2009 at 22:19:08
what does the cmd say when it comes to the ping command?

try to ping 127.0.0.0 or localhost, instead of 1.1.1.1


ping is working on my Server 2003


Report •

#2
April 13, 2009 at 00:36:23
OK, it's all working fine, except one major thing. You see where it says 'taskkill'. It's not working, taskkill is doing absolutely nothing to the batches the batch made.

So it's impossible for a batch to kill another batch? That's lame ...


Report •

#3
April 15, 2009 at 22:40:40
hmm

ive got a batch file that runs a bunch of other batch and vbs files, it reruns every 3.5 mins and if i want it to stop i use this

taskkill /im cmd.exe

in a batch file and that works just fine


Report •

Related Solutions

#4
April 16, 2009 at 17:57:42
when you are running a batch file its using cmd.exe not the batchfile name

Report •


Ask Question