Solved

Open multiple command windows and run a seperate command in each window.

Posted on 2014-03-05
1
285 Views
Last Modified: 2014-03-05
I have to open 32 command windows and run a command in each window. Such as

psshutdown @nyp1.txt -s -f -t 0

The name of the text file changes in each windows nyp1.txt   nyp2.txt  thru 32    - I wanted to know if there is a command that I can run that would automate the process by opening  the command windows and run the psshutdown command for me, so I don't have to do it manually?
0
Comment
Question by:Edward Pamias
1 Comment
 
LVL 82

Accepted Solution

by:
oBdA earned 500 total points
ID: 39906485
Try it like this:
@echo off
setlocal
for /l %%i in (1, 1, 32) do (
	start "Shutdown nyp%%i.txt" cmd.exe /c psshutdown.exe @nyp%%i.txt -s -f -t 0
)

Open in new window

0

Featured Post

Free book by J.Peter Bruzzese, Microsoft MVP

Are you using Office 365? Trying to set up email signatures but you’re struggling with transport rules and connectors? Let renowned Microsoft MVP J.Peter Bruzzese show you how in this exclusive e-book on Office 365 email signatures. Better yet, it’s free!

Join & Write a Comment

Several part series to implement Internet Explorer 11 Enterprise Mode
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now