You are viewing limited content. For full access, please sign in.

Question

Question

Problems running bat file from workflow script

asked on May 2, 2017

Hi!

i have an issue where WF script (c#)  doesn't execute a .bat file as i expect.

My workflow runs a .bat file (eg.  c:\script\runthis.bat)

This .bat runs a powershell script (eg c:\script\test.ps1) and some copy/del operations.

When i run it manually, it works fine. (dclick in explorer)

If i run it from the script editor and manually put in the tokens, it runs fine.

If i run the whole WF,  the commands to copy or delete run fine, but the powershell one does nothing.
i can't see any errors (but assume it must be getting one, its like it just skips the line).

I suspect its something to do with the location of the files / user who launches it.

I'm logged in as the administrator, so i changed the WF service to use the same account and got the same result.

Does anyone know what i'm doing wrong?

 

Thanks

Mark

0 0

Replies

replied on May 3, 2017

Hi Mark,

If you haven't already it might be worth checking the Security tab in the Workflow Administration Console to see what options are set under File Browsing:

I don't know whether Workflow/the script editor still use these constraints when run manually, but it might be something to try.

Cheers, Dan

0 0
replied on May 4, 2017

Dan,

Thanks for that. I tried enabling the file browsing, but no change.

I've now got the powershell script to save its output to a file, so i can see the errors.

I have setup the powershell script to run as an administrator account rather than local system, and this has helped with most of the errors.

It now is running, but gets an error at the end of the script.  So i've made good progress, but still not quite done :(

 

Thanks

Mark

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.