Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Ok so i have this batch file to ping a list of ip's
This is what i have:
@echo off
cd C:\Documents and Settings\username\My Documents\Ping printers
ping -n 1 172.16.1.223 >> pinginfo1.txt
ping -n 1 172.16.1.220 >> pinginfo2.txt
ping -n 1 172.16.1.214 >> pinginfo3.txt
ping -n 1 172.16.1.218 >> pinginfo4.txt
ping -n 1 172.16.1.215 >> pinginfo5.txt
ping -n 1 172.16.1.221 >> pinginfo6.txt
ping -n 1 172.16.1.222 >> pinginfo7.txt
ping -n 1 172.16.1.224 >> pinginfo8.txt
ping -n 1 172.16.1.219 >> pinginfo9.txt
ping -n 1 172.16.1.216 >> pinginfo10.txt
ping -n 1 172.16.1.217 >> pinginfo11.txtI get the error:
The filename, directory name, or volume label syntax is incorrect.
I am not a scripter or a programmer, i am new to this, so if you see anything wrong or have any suggestions to my batch file, i would be very happy.Thanks,
Sype

@echo off
cd "C:\Documents and Settings\%username%\My Documents\Ping printers"
ping -n 1 172.16.1.223 >> pinginfo1.txt
ping -n 1 172.16.1.220 >> pinginfo2.txt
ping -n 1 172.16.1.214 >> pinginfo3.txt
ping -n 1 172.16.1.218 >> pinginfo4.txt
ping -n 1 172.16.1.215 >> pinginfo5.txt
ping -n 1 172.16.1.221 >> pinginfo6.txt
ping -n 1 172.16.1.222 >> pinginfo7.txt
ping -n 1 172.16.1.224 >> pinginfo8.txt
ping -n 1 172.16.1.219 >> pinginfo9.txt
ping -n 1 172.16.1.216 >> pinginfo10.txt
ping -n 1 172.16.1.217 >> pinginfo11.txt"Computer security." — Oxymoron

Thanks, i figured out what the problem was. I had two batch files in one folder, and they were named "ping" and "ping2" I removed the ping batch and the ping2 worked. I did not know you could have more than two "batch" files in one folder.

There just normal files as any other file. It is not a good idea to name your batch files the same as internal or external commands.
"Computer security." — Oxymoron

![]() |
![]() |
![]() |

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