Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Using PSshutdown to Shutdown multiple Compuers at once...

Posted on 2009-05-16
4
1,638 Views
Last Modified: 2013-11-10
Hello,

I have a small bat file that shut's down a single computer using the Psshutdown tool. I would like to use it to shutdown more that one computer....Code is below..
psshutdown.exe \\<computer ip> -t 10  -f -u <username> -p <password>

Open in new window

0
Comment
Question by:Atomicsteaks
  • 2
4 Comments
 
LVL 69

Expert Comment

by:Qlemo
ID: 24402342
put the IPs into a file, each address on a separate line, and use
psshutdown @ips.txt -t 10 -f -u username -p password

0
 
LVL 84

Accepted Solution

by:
oBdA earned 500 total points
ID: 24402345
Simply put the names or addresses of those machines into a list and use the (path and) name of this file instead of the machine name, with an @ in front.

Or, if you want to do it all from within the batch file:


psshutdown.exe @"C:\Temp\shutdown.txt" -t 10  -f -u <username> -p <password>
 
 
@echo off
set ComputerList=1.2.3.4 1.2.3.5 SomeName
for %%a in (%ComputerList%) do psshutdown.exe \\%%a -t 10  -f -u <username> -p <password

Open in new window

0
 

Author Closing Comment

by:Atomicsteaks
ID: 31582194
Thx
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 24497011
Did you use the for approach?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This is about my first experience with programming Arduino.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question