Question

Simultaneous Commands in Batch File, When they are done, Process more commands.

Asked by: rjohnsonjr

Is it possible to have 3 different processes running simultaneously, but wait till all processes are done running before proceeding?

Here is an example:

:: Start Batch File

::Run the following 3 commands simultaneously

Command 1

Command 2

Command 3


::After All 3 commands above are done, do the following:

Command 4

Command 5


:: End Batch File

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2007-06-18 at 07:10:41ID22640556
Tags

batch

,

file

,

simultaneous

,

commands

Topics

Windows Batch Scripting

,

Windows Programming

,

Microsoft Windows Operating Systems

Participating Experts
4
Points
518
Comments
34

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. wait till batch file is done
    hi, how can i shell out to a batch file, and wait till it's done before executing next command?
  2. PC Batch File: Wait for the job finishing
    A commercial code (code_A) runs on command line window (win2k and win9x). After the job is submitted, the control will be returned to the window immediately and two or three consecutive sub-programs (p1, p2 & p3) on background (cpu time = 1 min. to 2 weeks). The sub-progr...
  3. Trying to open multiple CMD.EXE's to run simultaneously i…
    I have a SQL DTS job and at one point, I call five concurrent DOS processes in an attempt to spawn 5 file copy processes simultaneously. Each of the 5 concurrent DTS steps runs a batch file that copies a file from a remote server to the local machine. I am calling the batch...
  4. Batch file to execute two .exe's
    I need to create a batch file to execute two exe's (file1.exe & file2.exe). These files are zip archives that self-extract. The important thing here is that file1.exe needs to be unzipped first before file2.exe starts unzipping. (It will show an error if file2.exe runs...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: RQuadlingPosted on 2007-06-18 at 07:15:06ID: 19307211

You can. The simplest way is to use something like a file to act as a flag.

Each of the commands would be another batch file (or the same one!)

Here is an example where I will open notepad and calc at the same time and wait for both of them to finish.

 

by: RQuadlingPosted on 2007-06-18 at 07:17:15ID: 19307231

The reason for the file as a flag is inter-process communication can be a nightmare and files as flags (or rather dirs as they are created atomically) is universal (i.e. all OS's).

 

by: SteveGTRPosted on 2007-06-18 at 07:22:31ID: 19307275

Here's a method I create. First you create the following batch file that I named ProcMark.bat:

@echo off

setlocal

pushd

set markerFile=%~1

del "%markerFile%" 2^>NUL

shift

call %2 %3 %4 %5 %6 %7 %8 %9

popd

echo.>"%markerFile%"

exit

Then in you other batch file you'd say:

@echo off

setlocal

start procmark.bat mark1.txt dir
start procmark.bat mark2.txt dir
start procmark.bat mark3.txt dir

:LOOP

echo Waiting...

for /l %%a in (1, 1, 3) do if not exist mark%%a.txt goto LOOP

echo Done...

REM ** Do other commands



 

by: RQuadlingPosted on 2007-06-18 at 07:45:44ID: 19307488

@ECHO OFF
REM If we have a parameter then jump straight to the loader
IF NOT "%1"=="" GOTO Loader

REM We need to know where to watch for completion.
FOR /F "tokens=1-7 delims=:\/. " %%A IN ("%DATE% %TIME%") DO SET WatchPath=%TEMP%\%%A%%B%%C%%D%%E%%F%%G
MD %WatchPath%
ECHO Looking in %TEMP%\%WatchPath% for completion indicators.

REM Reset the watches
SET Watches=

REM Let's start the various tasks
CALL :PreLoad 1 "C:\WINDOWS\system32\notepad.EXE"
CALL :PreLoad 2 "C:\WINDOWS\system32\calc.EXE"

REM Now we wait.
:WatchLoop
SET NotFinished=No
FOR %%A IN (%Watches%) DO IF NOT EXIST %WatchPath%\%%A SET NotFinished=Yes
SLEEP -m 1000
IF "%NotFinished%"=="Yes" GOTO WatchLoop

REM We've finished.
ECHO All tasks completed.
RD /Q /S %WatchPath%
PAUSE
GOTO :EOF

REM Remember what we've started.
:PreLoad
SET Watches=%Watches% %1

REM Load the loader as a separate task
START /Min /Low %~fs0 %1 %~fs2
GOTO :EOF

REM Load the main task and wait for completion.
:Loader
START /WAIT %2
MKDIR %WatchPath%\%1
EXIT


The only external requirement is the freely available Windows Resource Tool Kit for the sleep program.

 

by: RQuadlingPosted on 2007-06-18 at 07:48:56ID: 19307519

If you know the tasks are going to take a long time, then increase the SLEEP value.

1000 = 1 second

60000 = 1 minute

for example.

Completing the tasks before that won't make the watcher quit any earlier.

If you don't have the sleep command, the loop takes up too much processing time - try it - your machine will run like a lame duck.

The tool kit is free from http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en

 

by: RQuadlingPosted on 2007-06-18 at 07:55:10ID: 19307585

Oops. Typo ...

ECHO Looking in %TEMP%\%WatchPath% for completion indicators.

should be ...

ECHO Looking in %WatchPath% for completion indicators.

Other than that it works OK.

If you want to pass the calling program parameters then here is the corrected code with the notepad opening the batch file! DON'T MAKE ANY CHANGES TO IT WHILST IT IS RUNNING!!!!

@ECHO OFF
REM If we have a parameter then jump straight to the loader
IF NOT "%1"=="" GOTO Loader

REM We need to know where to watch for completion.
FOR /F "tokens=1-7 delims=:\/. " %%A IN ("%DATE% %TIME%") DO SET WatchPath=%TEMP%\%%A%%B%%C%%D%%E%%F%%G
MD %WatchPath%
ECHO Looking in %WatchPath% for completion indicators.

REM Reset the watches
SET Watches=

REM Let's start the various tasks
CALL :PreLoad 1 "C:\WINDOWS\system32\notepad.EXE" %~fs0
CALL :PreLoad 2 "C:\WINDOWS\system32\calc.EXE"

REM Now we wait.
:WatchLoop
SET NotFinished=No
FOR %%A IN (%Watches%) DO IF NOT EXIST %WatchPath%\%%A SET NotFinished=Yes
SLEEP -m 1000
IF "%NotFinished%"=="Yes" GOTO WatchLoop

REM We've finished.
ECHO All tasks completed.
RD /Q /S %WatchPath%
PAUSE
GOTO :EOF

REM Remember what we've started.
:PreLoad
SET Watches=%Watches% %1

REM Load the loader as a separate task
SET Args=
:AddArg
SET Args=%Args% %3
IF "%4"=="" GOTO GotArgs
SHIFT 3
GOTO AddArg
:GotArgs
ECHO About to run %~fs2 %Args%
START /Min /Low %~fs0 %1 %~fs2 %Args%
GOTO :EOF

REM Load the main task and wait for completion.
:Loader
START /WAIT %2 %3
MKDIR %WatchPath%\%1
EXIT

 

by: RQuadlingPosted on 2007-06-18 at 07:56:09ID: 19307593

Now, to get this to work for your scenario ...

 

by: RQuadlingPosted on 2007-06-18 at 08:01:06ID: 19307634

@ECHO OFF
REM If we have a parameter then jump straight to the loader
IF NOT "%1"=="" GOTO Loader


REM Let's start the various tasks
CALL :PrepareWatch
CALL :PreLoad 1 "C:\WINDOWS\system32\notepad.EXE" %~fs0
CALL :PreLoad 2 "C:\WINDOWS\system32\calc.EXE"
CALL :PreLoad 3 "C:\WINDOWS\system32\taskmgr.EXE"
CALL :WatchLoop

CALL :PrepareWatch
CALL :PreLoad 1 "C:\WINDOWS\system32\write.EXE" %~fs0
CALL :PreLoad 2 "C:\WINDOWS\system32\sysedit.EXE"
CALL :WatchLoop


GOTO :EOF



:PrepareWatch
REM We need to know where to watch for completion.
MD %WatchPath%
FOR /F "tokens=1-7 delims=:\/. " %%A IN ("%DATE% %TIME%") DO SET WatchPath=%TEMP%\%%A%%B%%C%%D%%E%%F%%G
ECHO Looking in %WatchPath% for completion indicators.

REM Reset the watches
SET Watches=
GOTO :EOF



REM Now we wait.
:WatchLoop
SET NotFinished=No
FOR %%A IN (%Watches%) DO IF NOT EXIST %WatchPath%\%%A SET NotFinished=Yes
SLEEP -m 1000
IF "%NotFinished%"=="Yes" GOTO WatchLoop

REM We've finished.
ECHO All tasks completed.
RD /Q /S %WatchPath%
GOTO :EOF



REM Remember what we've started.
:PreLoad
SET Watches=%Watches% %1

REM Load the loader as a separate task
SET Args=
:AddArg
SET Args=%Args% %3
IF "%4"=="" GOTO GotArgs
SHIFT 3
GOTO AddArg
:GotArgs
ECHO About to run %~fs2 %Args%
START /Min /Low %~fs0 %1 %~fs2 %Args%
GOTO :EOF



REM Load the main task and wait for completion.
:Loader
START /WAIT %2 %3
MKDIR %WatchPath%\%1
EXIT

 

by: RQuadlingPosted on 2007-06-18 at 08:02:28ID: 19307644

Oops. Cut'n'paste error.

MD %WatchPath%
FOR /F "tokens=1-7 delims=:\/. " %%A IN ("%DATE% %TIME%") DO SET WatchPath=%TEMP%\%%A%%B%%C%%D%%E%%F%%G


should be ...

FOR /F "tokens=1-7 delims=:\/. " %%A IN ("%DATE% %TIME%") DO SET WatchPath=%TEMP%\%%A%%B%%C%%D%%E%%F%%G
MD %WatchPath%


Sorry.

Also, ...

REM We've finished.
ECHO All tasks completed.
RD /Q /S %WatchPath%
SET WatchPath=
GOTO :EOF


Add the

SET WatchPath=

line

 

by: RQuadlingPosted on 2007-06-18 at 08:03:07ID: 19307649

Hopefully, final version.

@ECHO OFF
REM If we have a parameter then jump straight to the loader
IF NOT "%1"=="" GOTO Loader


REM Let's start the various tasks
CALL :PrepareWatch
CALL :PreLoad 1 "C:\WINDOWS\system32\notepad.EXE" %~fs0
CALL :PreLoad 2 "C:\WINDOWS\system32\calc.EXE"
CALL :PreLoad 3 "C:\WINDOWS\system32\taskmgr.EXE"
CALL :WatchLoop

CALL :PrepareWatch
CALL :PreLoad 1 "C:\WINDOWS\system32\write.EXE" %~fs0
CALL :PreLoad 2 "C:\WINDOWS\system32\sysedit.EXE"
CALL :WatchLoop


GOTO :EOF



:PrepareWatch
REM We need to know where to watch for completion.
MD %WatchPath%
FOR /F "tokens=1-7 delims=:\/. " %%A IN ("%DATE% %TIME%") DO SET WatchPath=%TEMP%\%%A%%B%%C%%D%%E%%F%%G
ECHO Looking in %WatchPath% for completion indicators.

REM Reset the watches
SET Watches=
GOTO :EOF



REM Now we wait.
:WatchLoop
SET NotFinished=No
FOR %%A IN (%Watches%) DO IF NOT EXIST %WatchPath%\%%A SET NotFinished=Yes
SLEEP -m 1000
IF "%NotFinished%"=="Yes" GOTO WatchLoop

REM We've finished.
ECHO All tasks completed.
RD /Q /S %WatchPath%
SET WatchPath=
GOTO :EOF



REM Remember what we've started.
:PreLoad
SET Watches=%Watches% %1

REM Load the loader as a separate task
SET Args=
:AddArg
SET Args=%Args% %3
IF "%4"=="" GOTO GotArgs
SHIFT 3
GOTO AddArg
:GotArgs
ECHO About to run %~fs2 %Args%
START /Min /Low %~fs0 %1 %~fs2 %Args%
GOTO :EOF



REM Load the main task and wait for completion.
:Loader
START /WAIT %2 %3
MKDIR %WatchPath%\%1
EXIT

 

by: SteveGTRPosted on 2007-06-18 at 08:03:48ID: 19307655

Take your time...

 

by: RQuadlingPosted on 2007-06-18 at 08:07:41ID: 19307689

Sorry. I get a little excited when I create something for someone else and then realise I can actually use that!

This script is something I've been wanting for myself for ages - a delayed loader during startup.

It's a pain having so many things start all at once when I turn the pc on. By using the script I've just built, I can use it to delay load the various things I want without my machine grinding to a halt trying to load all of them at once.

Ok, not EXACTLY the same script, but the programs I have can be monitored and I can check their state before loading the next set of tasks.

Anyway, slower next time.

 

by: rjohnsonjrPosted on 2007-06-18 at 10:42:13ID: 19308963

Thanks for your help!  That was quick.  I will test your solutions later today or tomorrow and let you know how it goes.

-Randy

 

by: rjohnsonjrPosted on 2007-06-18 at 12:41:26ID: 19309916

Hello,

Your script appears to be working fine.   It is giving me a syntax error though.

C:\>batch1.bat
The syntax of the command is incorrect.
Looking in C:\\Mon06182007153916 for completion indicators.
About to run C:\WINDOWS\system32\notepad.exe  C:\batch1.bat
About to run C:\WINDOWS\system32\calc.exe
About to run C:\WINDOWS\system32\taskmgr.exe


Here is the copy paste from the batch file

@ECHO OFF
REM If we have a parameter then jump straight to the loader
IF NOT "%1"=="" GOTO Loader


REM Let's start the various tasks
CALL :PrepareWatch
CALL :PreLoad 1 "C:\WINDOWS\system32\notepad.EXE" %~fs0
CALL :PreLoad 2 "C:\WINDOWS\system32\calc.EXE"
CALL :PreLoad 3 "C:\WINDOWS\system32\taskmgr.EXE"
CALL :WatchLoop

CALL :PrepareWatch
CALL :PreLoad 1 "C:\WINDOWS\system32\write.EXE" %~fs0
CALL :PreLoad 2 "C:\WINDOWS\system32\sysedit.EXE"
CALL :WatchLoop


GOTO :EOF



:PrepareWatch
REM We need to know where to watch for completion.
MD %WatchPath%
FOR /F "tokens=1-7 delims=:\/. " %%A IN ("%DATE% %TIME%") DO SET WatchPath=%TEMP%\%%A%%B%%C%%D%%E%%F%%G
ECHO Looking in %WatchPath% for completion indicators.

REM Reset the watches
SET Watches=
GOTO :EOF



REM Now we wait.
:WatchLoop
SET NotFinished=No
FOR %%A IN (%Watches%) DO IF NOT EXIST %WatchPath%\%%A SET NotFinished=Yes
SLEEP -m 1000
IF "%NotFinished%"=="Yes" GOTO WatchLoop

REM We've finished.
ECHO All tasks completed.
RD /Q /S %WatchPath%
SET WatchPath=
GOTO :EOF



REM Remember what we've started.
:PreLoad
SET Watches=%Watches% %1

REM Load the loader as a separate task
SET Args=
:AddArg
SET Args=%Args% %3
IF "%4"=="" GOTO GotArgs
SHIFT 3
GOTO AddArg
:GotArgs
ECHO About to run %~fs2 %Args%
START /Min /Low %~fs0 %1 %~fs2 %Args%
GOTO :EOF



REM Load the main task and wait for completion.
:Loader
START /WAIT %2 %3
MKDIR %WatchPath%\%1
EXIT

 

by: SteveGTRPosted on 2007-06-18 at 12:59:27ID: 19310094

Did you try my script?

 

by: SteveGTRPosted on 2007-06-18 at 13:02:04ID: 19310130

Just to elaborate on the usage of this line:

start procmark.bat mark1.txt dir

Procmark.bat accepts a marker file name and the command to run. In this case the marker file is named mark1.txt and the command is the dir command. The command could easily been an executable or another batch file with or without parameters specified. The code allows for up to 7 parameters to be passed to the procmark.bat's command portion.

 

by: RobSampsonPosted on 2007-06-18 at 22:15:55ID: 19313303

Hi guys, seeing as your using DOS Batch, this is probably more just FYI, but I have created a VBScript that can control such issues, along with a batch file that calls it.

I wrote a vb script that takes vbs files as parameters, and keeps running until the passed scripts have finished.  This way, it returns back to the START /WAIT command that called it.

I have called this script RunAndWait.vbs"
'===================================
'MUST BE RUN BY: START /WAIT RunAndWait.vbs script1.vbs script2.vbs
If WScript.Arguments.Count > 0 Then
      strWhileCondition = "Do Until "
      Set wshShell = CreateObject("WScript.Shell")
      For intArgNum = 0 To WScript.Arguments.Count - 1
            strCodeToExec = "Set objExec" & intArgNum & " = wshShell.Exec(""wscript.exe " & WScript.Arguments(intArgNum) & """)"
            Execute strCodeToExec
            If intArgNum < WScript.Arguments.Count - 1 Then
                  strWhileCondition = strWhileCondition & "objExec" & intArgNum & ".Status OR "
            Else
                  strWhileCondition = strWhileCondition & "objExec" & intArgNum & ".Status"
            End If
      Next
      strWhileCondition = strWhileCondition & VbCrLf & "WScript.Sleep 500" & VbCrLf & "Loop"
      Execute strWhileCondition
End If
'============================

And in Master.bat I have these lines:
@echo off
start /wait RunAndWait.vbs file1.vbs file2.vbs file3.vbs
start /wait RunAndWait.vbs file4.vbs

What this does is run 1, 2, and 3 concurrently, and the vbs uses dynamic code through the Execute statement to monitor all three Exec processes.  Then when the RunAndWait.vbs script has finished, the batch file kicks in again, and runs file4.

Basically, I figure that in the  Master.bat, you place a RunAndWait.vbs statement for each "block" of scripts that you are allowed to run concurrently.

Now, given that you are running "commands" and not "files", this doesn't suit exactly, *but* you could alter the RunAndWait.vbs to process "commands" that were passed to it, which it would execute in separate command prompts.

Anyway, that's just my two cents.

Regards,

Rob.

 

by: RobSampsonPosted on 2007-06-18 at 22:24:22ID: 19313339

I've just realised that the OR at the end of this line:
strWhileCondition = strWhileCondition & "objExec" & intArgNum & ".Status OR "

needs to be an AND, so it should read;
strWhileCondition = strWhileCondition & "objExec" & intArgNum & ".Status AND "

Regards,

Rob.

 

by: RQuadlingPosted on 2007-06-19 at 01:09:29ID: 19313997

Oops. Another typo.

Replace the :PrepareWatch code with this ...

:PrepareWatch
REM We need to know where to watch for completion.
FOR /F "tokens=1-7 delims=:\/. " %%A IN ("%DATE% %TIME%") DO SET WatchPath=%TEMP%\%%A%%B%%C%%D%%E%%F%%G
MD %WatchPath%
ECHO Looking in %WatchPath% for completion indicators.

REM Reset the watches
SET Watches=
GOTO :EOF





I STILL had the MD in the wrong place. Sorry.

 

by: RQuadlingPosted on 2007-06-19 at 01:13:59ID: 19314016

Don't forget the SLEEP program from Windows Resource Tool Kit. Oh. My PATH has the path to the tool kit too as this means I don't need to use C:\Progra~1\WI8DE7~1\Tools\Sleep and the WI8DE7~1 would probably be different on every users machine, but by having it in PATH, you can just run the program, or call it from a batch file.

 

by: RobSampsonPosted on 2007-10-29 at 17:11:59ID: 20174122

rjohnsonjr,

Have any of the solutions provided given you a satisfactory solution?

Regards,

Rob.

 

by: RQuadlingPosted on 2008-04-12 at 04:18:25ID: 21340628

This is a REALLY old question and I hope that the comments here covered enough for you to award some points.

 

by: moosecaboosePosted on 2008-11-20 at 04:23:10ID: 23002942

Not being funny or anything, and I love you gorgeous code... but.. seriously overkilled.... You can do simultaneous copys with a simple switch.. Start.

For example. I wanted to clone 8 USB drives at a time from a pre-set folder on my desktop.. I created this

---BATCH FILE---
robocopy c:\USBClone\Files d: /mir
robocopy c:\USBClone\Files e: /mir
robocopy c:\USBClone\Files f: /mir
robocopy c:\USBClone\Files g: /mir
robocopy c:\USBClone\Files h: /mir
robocopy c:\USBClone\Files i: /mir
robocopy c:\USBClone\Files j: /mir
robocopy c:\USBClone\Files k: /mir
----END BATCH FILE---

As you know this will do the copy one after another... I wanted the process to be quicker so I added the Start switch to run all commands at the same time. So.. New batch file is now as follows

---START BATCH FILE---
Start robocopy c:\USBClone\Files d: /mir
Start robocopy c:\USBClone\Files e: /mir
Start robocopy c:\USBClone\Files f: /mir
Start robocopy c:\USBClone\Files g: /mir
Start robocopy c:\USBClone\Files h: /mir
Start robocopy c:\USBClone\Files i: /mir
Start robocopy c:\USBClone\Files j: /mir
Start robocopy c:\USBClone\Files k: /mir
----END BATCH FILE---

Simple. easy to read. Not overkill at all.. In your case;

---START BATCH FILE---
::Run the following 3 commands simultaneously

Start Command 1
Start Command 2
Start Command 3

::After All 3 commands above are done, do the following (To make these simultaneous add start before them.):

Command 4
Command 5

---END BATCH FILE---

I hope that helps. I just saved myself £800 on a USB duplicator by making it simple!!

---START BATCH FILE---
::Run the following 3 commands simultaneously
 
Start Command 1
Start Command 2
Start Command 3
 
::After All 3 commands above are done, do the following:
 
Command 4
Command 5
---END BATCH FILE---

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:

Select allOpen in new window

 

by: RQuadlingPosted on 2008-11-20 at 06:20:07ID: 23003846

moosecaboose, Command 4 will start immediately after STARTING command3, not COMPLETING commands 1,2 and 3.


 

by: moosecaboosePosted on 2008-12-16 at 08:52:00ID: 23185351

remove start from command 3 then.

 

by: rjohnsonjrPosted on 2009-01-08 at 08:30:06ID: 23326655

We went in another direction on this project because we could not have more than 1 connection to the server we were trying to use this for.  You guys did a lot of good work here so I want to assign the points.  I will ask you to decide who gets the points and I will award accordingly.

Thanks for taking the time to answer and I am sorry it took me so long to get back to you.

 

by: RobSampsonPosted on 2009-05-25 at 15:52:44ID: 24469175

Ha ha, SteveGTR, RQuading, RQuading, RQuading, RQuading, RQuading, and RQuading!

I always thought you worked like a machine, and now I know....there's six of you! LOL!

Or is just me and my silly sense of humour?  :-(

 

by: RQuadlingPosted on 2009-05-27 at 06:22:43ID: 24482710

I am not a machine.

 

by: RQuadlingPosted on 2009-05-27 at 06:22:54ID: 24482712

Nor am I

 

by: RQuadlingPosted on 2009-05-27 at 06:23:02ID: 24482714

Me neither.

 

by: RQuadlingPosted on 2009-05-27 at 06:23:15ID: 24482716

I'm not so sure.

 

by: RQuadlingPosted on 2009-05-27 at 06:23:40ID: 24482720

The others ARE machines. I'm the original.

 

by: RQuadlingPosted on 2009-05-27 at 06:24:39ID: 24482730

Well, you see what the others think. It makes little difference, 'cause I'm the one with the remote cont....[click]

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...