Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Execute Process Task - Working Directory

Author  Topic 

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2011-03-31 : 12:01:09
Hi all,

I have a simple Execute Process task which will run Robocopy from a .bat file. I have not been able to get it to run successfully.

The Executable line has: C:\JobScripts\FLTCTRLArchiveMoveFiles.bat

Working Directory is set to: C:\JobScripts
The error I get is:
[Execute Process Task] Error: In Executing "C:\JobScripts\FLTCTRLArchiveMoveFiles.bat" "" at "C:\JobScripts\", The process exit code was "1" while the expected was "0".

I'm confused about what to place in the Working Directory box.

The .bat is straightforward - it just invokes ROBOCOPY to MOVE files from 1 folder to another - and it works when I run it from the command line.

If you have any ideas, please throw them my way.
Thanks,John


russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-04-03 : 23:41:07
service account has permissions on the batch file and everything referenced in it?
Go to Top of Page

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2011-04-04 : 18:02:37
quote:
Originally posted by russell

service account has permissions on the batch file and everything referenced in it?



Thanks, Russell. Yes, the service account is a member of the Administrators group.

The Execute Tasks executable line is: C:\JobScripts\FLTCTRLArchiveMoveFiles.bat

Working directory is C:\JobScripts\
** What should I place in Working Directory ??

This is my little bat file:

Rem Move qualifying Flight Control files to archives folder
Rem *******************************************************
ROBOCOPY C:\RAMCO\HISTORY\SABRE\FLTCTRL\ C:\RAMCO\HISTORY\SABRE\FLTCTRLarchives\ *.msg /MOV /MINAGE:1

Wow, sometimes the simplest things can be difficult :)

Thanks for any tips. John

Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-04-04 : 22:13:59
leave it blank
Go to Top of Page

jbates99
Constraint Violating Yak Guru

396 Posts

Posted - 2011-04-04 : 22:26:18
quote:
Originally posted by russell

leave it blank



Russell,

I'm making some progress.... by making 2 changes

1. In my crummy little .bat file I added a change directory line:

CD C:\Robocopy
ROBOCOPY C:\RAMCO\HISTORY\SABRE\FLTCTRL\ C:\RAMCO\HISTORY\SABRE\FLTCTRLarchives\ *.msg /MOV /MINAGE:1

At this point, the package runs and moves the files as intended. BUT the package (in debug mode) returns RED/failed. Dont understand that

2. So I changed the Exec Process tasks option for "Fail If Errors Occur" to FALSE. Shouldn't have to force it, because I want to know about any problems.

Now, in Debug mode, the package runs successfully.

My next step is to get it to run as an Agent job.

This is the first .bat file I have tried to execute in SSIS. I have lots of them running as Scheduled Tasks though, even using Robocopy and I didn't have to use a CD statement.

I learned a bit from this today.

Thanks for taking an interest in my problem, Russell.
John

Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2011-04-04 : 22:27:44
Glad you're making progress. Keep posting with any issues you need assistance with
Go to Top of Page
   

- Advertisement -