Link to home
Start Free TrialLog in
Avatar of ABaruh
ABaruh

asked on

Trying to open multiple CMD.EXE's to run simultaneously in my DTS Package

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 file like:

start c:\Batches\FileCopy.bat

In the batch file, I have

copy MyFile c:\Files\
exit

I thought that by using start and exit, my 5 DTS steps would cause 5 CMD.EXE's to be opened simultaneously, but when I watch Task Manager, I see one CMD.EXE, although the Process ID is changing constantly as the files are copied.

Can anyone tell me if this is working normally or how to cause 5 separate CMD.EXE's to be opened simultaneuosly?
Avatar of Saqib Khan
Saqib Khan
Flag of United States of America image

Why Dont you Create a JOB and Then Run each BAT file for Each STEP?
Avatar of ABaruh
ABaruh

ASKER

There's a lot more that is happening in the SQL that calls the BAT
Avatar of Melih SARICA
Yes its normal to see only one CMD o process list.

It does'nt run any process till a command runs. and every command creates a process on OS.


Avatar of ABaruh

ASKER

non_zero, are you saying that I don't need to be concerned about seeing one CMD.EXE in Task Manager and that it is still running the various processes simultaneously?  Please clarify.

Nevertheless, why is it that if I open multiple command windows manually (by typing cmd in my Run dialog box) I will see a separate CMD.EXE for each of those windows?
I don't think you can call 5 cmd.exe's in one DTS package with 5 steps.

Not sure what was logic inside this ...

But, you can create 5 DTS package and run them simulataneously. This might work.
I don't think you are ever going to guarantee simultaneous copying.
If this is absolutley necessary you might want to consider creating a multi-threaded component in VB which creates 5 child objects, each of which wait on separate threads for an exact moment when they start copying together.
Even then, there may be some lag between copies.
Avatar of ABaruh

ASKER

You guys are getting away from the point.  I'm pretty sure this can be done as I can multi-copy manually if I open 5 dos windows and perform file copies simultaneously in each of them.  Let's focus on why I'm not seeing 5 CMD.EXE's launching.
Avatar of ABaruh

ASKER

I figured it out:

I had to create 5 separate SQL Server connections inside my DTS Package, and each of the 5 concurrent DTS steps were given their own SQL connection (each of the 5 DTS steps runs a stored proc that executes xp_cmdshell).
Close the question...
ASKER CERTIFIED SOLUTION
Avatar of ee_ai_construct
ee_ai_construct
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial