Need help on batch script to shutdown computers from list

Jack 0 Reputation points
2023-08-03T07:21:07.16+00:00

Hi, I would need help to write a bat file to shutdown all the computers listed in the text file. Can someone help me please?

This script will extract the list of computers name from the text file and loop to shutdown each computer.

Windows for business | Windows Client for IT Pros | User experience | Other
{count} votes

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Reza-Ameri 17,336 Reputation points Volunteer Moderator
    2023-08-04T07:57:18.39+00:00

    The script could be as follow:

    $PCList = Import-Csv -Path .\ComputerList.csv

    foreach ($PC in $PCList )

    {

    Stop-Computer -ComputerName. -$PC.ComputerName -Force

    }

    Let me know if that work as expected.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.