Advertisement

07.02.2008 at 07:41AM PDT, ID: 23533716
[x]
Attachment Details

Executing CMD file within VB Script in an ActiveX task in DTS

Asked by dbbishop in MS SQL DTS, VB Script, ActiveX

I have an ActiveX task in a DTS package (SQL Server 2000) that is building a .cmd file that I wish to then execute from within the script.  The code I have is shown below. The data shown in the msgbox is correct (an example would be:
  C;\WINNT\TEMP\Equipment.cmd

The contents of the cmd file executes ftp.exe with parameters, including pointing to a script file in the same (temp) folder.

If I go to the TEMP folder and double-click on the .cmd file it works properly, but it appears that DTS never executes it. Some of the files I am trying to transfer are 100MB in size and the function appears to exit immediately after displaying the message box, and nothing is transferrred.

Is there another way I should be coding this?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
Function ExecuteShellProgram(CommandFileName)
	Dim poShell, poProcess, status
 
	msgbox "Executing " & CommandFileName
 
	Set poShell = CreateObject("WScript.Shell")
	Set poProcess = poShell.Exec(CommandFileName)
	...
End Function
[+][-]07.02.2008 at 07:50AM PDT, ID: 21916996

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 08:06AM PDT, ID: 21917136

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 09:14AM PDT, ID: 21917953

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL DTS, VB Script, ActiveX
Sign Up Now!
Solution Provided By: sirbounty
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906