Jump to content

Recommended Posts

Posted

I copied ping.exe to a root drive on a domain controller. Along with this i created a text file called PC.txt (which lists all the PCs in our domain) and a batch file with the command

ping.exe pc.txt >> answer.txt

When i run this batch it doesnt return any ping results in answer.txt- how can i ping all pcs in a domain?

thx


Posted

Thanks for that but how do i add my text file to this code (PC.txt). Im guessing to replace 192.... with my text file name, but that didnt work????

I didnt know about Powershell so thanks for the link and ill look into it. :thumbup

Posted (edited)
You can't do that with DOS, you'll need to rewrite it into vb script:

Really? :w00t:

I would have thought that something like:

For /F "tokens=* delims=" %%A in (pc.txt) DO Ping %%A >> answer.txt

would work.... :whistle:

@Bad boy Warrior

Please read here a good tutorial about using the above command:

http://www.robvanderwoude.com/ntfortokens.html

and extracting needed data...

jaclaz

Edited by jaclaz
Posted

@travisowens - your solution will not ping every machine in a domain. only in a subnet.

jaclaz's solution will at least ping every machine in the text file. Which if the query to create it was done correctly can have every machine in the domain listed in it.

If you want to eliminate the text file you could use VBS to query the domain for machines and then ping them.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...