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

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

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

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

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

791 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