Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-03-05
1
Medium Priority
?
305 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
[X]
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
1 Comment
 
LVL 85

Accepted Solution

by:
oBdA earned 2000 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

618 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