Solved

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

Posted on 2014-03-05
1
292 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 84

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

749 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