SSIS execute .bat file not working

Isaac

Lifelong Learner
Local time
Yesterday, 17:32
Joined
Mar 14, 2017
Messages
9,626
Anyone have any ideas on this?

I have an powershell script (very simple -create a text file - a test of sorts) which works fine on its own.
I have a .bat file which runs the powershell script (necessary to set -ExecutePolicy bypass), which when double clicked, works perfectly - text file is created.

Now I have an SSIS package with an Execute Process task. You can see the configuration, I've triple checked the paths they're all correct.

but what happens when I execute the SSIS package is the cmd window just comes up and sits there as shown in the second picture. Indefinitely. Bat file never seems to run, because end result does not occur.

Window (2nd picture) sits there indefinitely (ssis package does NOT err out), as if waiting for something. I finally x-out of it, and ssis err's because process terminated without success code.
for awf.png


for awf2.png
 
I tested something, using a Script Task instead of an Execute Process task. In my script task was this
sorry can't post code but here is a screenshot:

for awf3.png


...... and it did the same thing. It brought up the command prompt, and waited for me to paste in the path to my .bat file and hit enter before it finished. Why is the cmd.exe not automatically running the bat file ??????
 
well, I suspect it is some security setting.

what i did instead is use an executeprocess task to run powershell.exe directly - this worked as long as I used the setexecution bypass setting
 
Is it possible to set the Executable to be the name of the .BAT file, and get rid of the arguments parameter?
The bat file *should* run without having to open up a CMD window. You just wouldn't see the results on screen I think.
 
You make an excellent point. Next time I have some down time I'm going to test that. Didn't even think of that!
 

Users who are viewing this thread

Back
Top Bottom