Hi, we got around 600 computers here where I work and I wanna check which are online.
Since some arent used but are set up and so on.
Ping Computer1 > "C:\PingResults.txt"
Ping Computer2 >> "C:\PingResults.txt"
Ping Computer3 >> "C:\PingResults.txt"
Ping Computer4 >> "C:\PingResults.txt"
Ping Computer5 >> "C:\PingResults.txt"
the out put is
C:\Users\knakpete\Desktop>Ping Computer1 1>"C:\PingResults.txt"
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
Any ideas?
BR
Kim Petersson , Sweden
Mass Ping .Bat file Writing, output to a .txt
Moderator: DosItHelp
Re: Mass Ping .Bat file Writing, output to a .txt
Did you call it ping.bat ?
Re: Mass Ping .Bat file Writing, output to a .txt
No I didn't since I know I cant call it that. I call it something like "MassPingFileForProduction.bat" or so. 
Best Regards
Kim Petersson, Sweden

Best Regards
Kim Petersson, Sweden
Re: Mass Ping .Bat file Writing, output to a .txt
Reboot your computer and try it again. Something is holding "C:\PingResults.txt" open.
Re: Mass Ping .Bat file Writing, output to a .txt
Already did,
Best Regards
Kim Petersson, Sweden
Best Regards
Kim Petersson, Sweden
Re: Mass Ping .Bat file Writing, output to a .txt
if you open a cmd prompt in the same folder as the batch file, can you enter a ping command? There may be a second ping executable somewhere (bat/cmd/exe/com) or on the path.
You didn't show the exact batch file so it could be something else in your batch file too.
You didn't show the exact batch file so it could be something else in your batch file too.
Re: Mass Ping .Bat file Writing, output to a .txt
Its the exact batch file. only that i Have like 200 more lines of the smae thing except a new computer name.
Im quite sure it has nothing to do that something else is yousing it already. I think there is something I need to put in betweeen the ping lines to wait the command out.
Best Regards
Kim Petersson, Sweden
Im quite sure it has nothing to do that something else is yousing it already. I think there is something I need to put in betweeen the ping lines to wait the command out.
Best Regards
Kim Petersson, Sweden
Re: Mass Ping .Bat file Writing, output to a .txt
SOLVED IT.
The TXT file caused a problem when put directly on the C:\ for some reason. I changed it to another place and it worked.
Thanks for the help all of you.
The TXT file caused a problem when put directly on the C:\ for some reason. I changed it to another place and it worked.
Thanks for the help all of you.