Computing.Net > Forums > Programming > [BATCH] 'Ping' Command Not Working.

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

[BATCH] 'Ping' Command Not Working.

Reply to Message Icon

Name: Cruze
Date: April 12, 2009 at 20:04:47 Pacific
OS: Windows Server 2003 - 64bit
Subcategory: Batch
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: sniper62
Date: April 12, 2009 at 22:19:08 Pacific
Reply:

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


0

Response Number 2
Name: Cruze
Date: April 13, 2009 at 00:36:23 Pacific
Reply:

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 ...


0

Response Number 3
Name: sniper62
Date: April 15, 2009 at 22:40:40 Pacific
Reply:

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


0

Response Number 4
Name: sniper62
Date: April 16, 2009 at 17:57:42 Pacific
Reply:

when you are running a batch file its using cmd.exe not the batchfile name


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: [BATCH] 'Ping' Command Not Working.

FC command does NOT work in a batch www.computing.net/answers/programming/fc-command-does-not-work-in-a-batch/17859.html

/w command not working? www.computing.net/answers/programming/w-command-not-working/19577.html

DOS Batch File Commands www.computing.net/answers/programming/dos-batch-file-commands/14637.html