• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need some help with a batch file.

SilthDraeth

Platinum Member
I am trying to create a simple batch file that I will run as a service on a domain controller that will force shutdown an entire computer lab.

What I have is:

FOR /F "tokens=1" %%a in (%COMPUTERNAME%.txt) do shutdown -t 30 -S -f -m %%a

I then have a txt file with the names of each computer.

I test it with just my local workstation in the txt and it works perfectly. The problem I run into is: If a computer name exists in the txt file, but that computer is not powered on, or the name doesn't resolve through DNS, the script will just hang on that computer name and never finish.

How do I get it to exectute each line in the txt file, and keep running if it comes across a computer name it doesn't like?
 
Back
Top