dbTalk Databases Forums  

How to launch a process synchronously in my DTS

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss How to launch a process synchronously in my DTS in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
J-T
 
Posts: n/a

Default How to launch a process synchronously in my DTS - 07-25-2005 , 04:58 PM






I am calling a WINZIP process to extract a zipped file using the code below
:

Set oShell = CreateObject("WScript.Shell")
strCommand = "WZUNZIP.EXE" & " -e -o- " &
DTSGlobalVariables("gLocalImportFolder").Value & "\" & file & " " &
strTempUnZipFolder
oShell.Run strCommand

The problem is that I am calling this process several times by iterating
through a collection of zipped files and because the process is called
asynchronously inside the iteration when the process is called whilst the
unzipping process is not finished the control gose to the next commad which
is moving the file to another folder and it is causing me a problem.


Is there a workaround for this?

Thanks



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: How to launch a process synchronously in my DTS - 07-26-2005 , 02:33 AM






Run Method
(http://msdn.microsoft.com/library/de...l/wsmthrun.asp)


Look at the bWaitOnReturn parameter.


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

"J-T" <J-T (AT) nospam (DOT) com> wrote

Quote:
I am calling a WINZIP process to extract a zipped file using the code below
:

Set oShell = CreateObject("WScript.Shell")
strCommand = "WZUNZIP.EXE" & " -e -o- " &
DTSGlobalVariables("gLocalImportFolder").Value & "\" & file & " " &
strTempUnZipFolder
oShell.Run strCommand

The problem is that I am calling this process several times by iterating
through a collection of zipped files and because the process is called
asynchronously inside the iteration when the process is called whilst the
unzipping process is not finished the control gose to the next commad
which is moving the file to another folder and it is causing me a problem.


Is there a workaround for this?

Thanks




Reply With Quote
  #3  
Old   
J-T
 
Posts: n/a

Default Re: How to launch a process synchronously in my DTS - 07-26-2005 , 11:23 AM



Thanks Darren
"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
Run Method
(http://msdn.microsoft.com/library/de...l/wsmthrun.asp)


Look at the bWaitOnReturn parameter.


--
Darren Green
http://www.sqldts.com
http://www.sqlis.com

"J-T" <J-T (AT) nospam (DOT) com> wrote in message
news:Ovb5TQWkFHA.3960 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
I am calling a WINZIP process to extract a zipped file using the code
below :

Set oShell = CreateObject("WScript.Shell")
strCommand = "WZUNZIP.EXE" & " -e -o- " &
DTSGlobalVariables("gLocalImportFolder").Value & "\" & file & " " &
strTempUnZipFolder
oShell.Run strCommand

The problem is that I am calling this process several times by iterating
through a collection of zipped files and because the process is called
asynchronously inside the iteration when the process is called whilst the
unzipping process is not finished the control gose to the next commad
which is moving the file to another folder and it is causing me a
problem.


Is there a workaround for this?

Thanks






Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.