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

Posted on 2004-08-24
Last Modified: 2012-06-27
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\

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?
Question by:ABaruh
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
LVL 23

Expert Comment

by:Saqib Khan
ID: 11889217
Why Dont you Create a JOB and Then Run each BAT file for Each STEP?

Author Comment

ID: 11889276
There's a lot more that is happening in the SQL that calls the BAT
LVL 19

Expert Comment

by:Melih SARICA
ID: 11889304
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.

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.


Author Comment

ID: 11889382
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?
LVL 11

Expert Comment

ID: 11889389
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.

Expert Comment

ID: 11890148
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.

Author Comment

ID: 11892448
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.

Author Comment

ID: 11893597
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).
LVL 34

Expert Comment

ID: 11895195
Close the question...

Accepted Solution

ee_ai_construct earned 0 total points
ID: 11934733
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Moderator

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

751 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