more in the saga:
I don't know why the cmd.exe began working the ping - it hasn't done it
before.
FIRST: I took out the no-echo and saw the commands being processed. The ping
worked from within the bat file; but, it seems to ONLY work when I've got IE
window open. If I try to run the bat file- CONNECTED to the internet, BUT
WITHOUT IE open - it does NOT process the commands - it gives me the error
message that it couldn't find
www.google.com, try again and stops. If I open
IE - the bat file doesn't restart itself. but if (with ie open) I restart the
bat file it starts pinging again.
This is NOT how it worked B4 I did the complete reinstall. Before, even if
I wasn't connected to the internet the batch file would still work but give
non-halting error messages then continue on looping through the bat file
commands. But, like i said before, I don't know what settings are different
now.
SECOND: I took out the line "ping localhost -n 120 > nul" and now the bat
file does cycle. However it seems like it's pinging way too often (does it
hog bandwitdth and actually slow my surfing?) What does this command line
actually do? Whatever it is it doesn't seem to let the file cycle back to
"again:" often enough to keep my sprint connection open. If I use the file
without the line - it does keep it open (like I need) but it seems - to me-
that it slows down my overall browsing.
SO: what does that line to? Is it essential? Does it give a clue to any
settings that I've got which are wrong? Is there an alternative to slow the
pinging down a bit?
thanks
dj
Pegasus (MVP) said:
Try to walk before you run. In other words, before running
a ping command from within a batch file, run it from a command
prompt. This is how it works:
- Click Start / Run / cmd {OK}
- Type this command:
ping
www.google.com
If you do not get a response then there is something wrong
with your network setup or with your Internet connection.
This has nothing at all to do with the batch file. Fix up your
Internet connection, then start working with the batch file!
rrjmd said:
thanks for your reply -- I copy pasted your bat file to notepad and "saveas"d
keepopen.bat. then I clicked on it which opened a new small window with a
black background and a header bar which read C:WINDOWS\system32\cmd.exe
[which is exactly what happened when I used my old batch file as
well].
It
simply remained blank for about 30 sec then gave an error message:
"the
ping
request could not find host
www.google.com. Please check the name and try
again." [Now this error message was new to me - my old bat file never even
got that far]
But: that's as far as it went. the curser returned and it just set there
processing no more instructions- I could not tell whether or not it actually
pinged or accessed the internet connection before it gave the error messages.
any more suggestions? thanks again in advance for your help.
BTW - I do back up files - the file that I referenced did work before I
restored my system/ not any more afterwards - that's the problem.
:
I've used a simple .bat file to recycle through a ping command in order to
keep open my internet connection through my cell phone when I use
it.
It's
always worked well through the many upgrades from sp1 to sp2 etc.
Now, because HP said they couldn't create me a boot disk, I had to
do
a
complete fresh install using an OEM WinXPsp2 (and new codes from a call to
MS). But, now, I cannot get the batch file to work. The cmd.exe window
comes
up but no command lines are either shown or processed. I've tried
disabling
my zone alarm firewall and rewriting the bat file- all to no avail..
To me, it seems like there's a setting not set right - one that
might
have
not overwritten defaults the first time when upgrading; but, now which
doesn't get set correctly during a fresh install.
Can someone tell me how to get a .bat file to work in order to Ping -
using
WinXpxp2 ???
@echo off
:again
ping
www.google.com
ping localhost -n 120 > nul
goto again
If this does not work then you need to tell us exactly what
happens when you run it.
BTW, unless you enjoy re-inventing the wheel, you should
back up all tools (such as this one) and programs/drivers
(such as those you download from the Internet).