Issue running bat file using system.util.execute

Kinda lost on this. Ignition 7.9, I am trying to execute a bat file that runs commands to transfer files via ftps thru filezilla pro cli. The batch file works if I run it standalone or thru a cmd line. It also works if I run it in the script console, but it will not run thru a gateway script.

Its kind of confusing because I am able to run a similar program called putty sftp from a gateway script and I have another bat file that moves the csv file that I create into a "history" directory using a gateway script.

Any ideas I am at a loss?

My best guess is some sort of user permissions issue. The gateway would have different permissions than a client running under a different user. I suggest searching the forum in regard to changing the Ignition service user.

1 Like

Is filezilla on the gateway? Running it through a gateway script means it's running it with the file system on the gateway computer. Are you able to run it through command line on the gateway computer?

If so then @dkhayes117 is most likely correct and it's most likely a permission issue.

yes everything is local to the computer. Like I said the weird thing is I can run a bat file that moves files in the same folder that the filezilla bat file resides in... thru a gateway script.

Consider also using java's ProcessBuilder instead of system.util.execute. You can collect the stdout and stderr streams to log, and capture the process exit code.

1 Like

I have gotten around this kind of issue before. Try to run a shortcut to the .bat. Set the shortcut to run as admin.

1 Like