Execute Command - again.

Post Reply
User avatar
Terkelsen
Advanced member
Posts: 297
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Execute Command - again.

Post by Terkelsen »

I'm still trying to figure out how exactly to use Execute Command. Can it be used to, well, simply execute a command? Say, I just want to execute this simple bat-file:

@ECHO OFF
ECHO.
ECHO This is a batch file
ECHO.
PAUSE
CLS
EXIT

Is that possible, and if so, how do you configure the properties of Execute Command?
jan_suhr
Advanced member
Posts: 586
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Execute Command - again.

Post by jan_suhr »

If the command is more than one line you have to do a Batchfile (.bat) that you run in the Execute command. To create that with variables you can use my App "Execute command friend" it will let you create the .bat-file on the fly for Execute command.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
essexmate
Member
Posts: 30
Joined: Tue Sep 05, 2017 4:41 pm

Re: Execute Command - again.

Post by essexmate »

We run bat files all the time. To do this we set the Execute Command properties to run a Switch Script which in turn fires the bat file and moves the switch job to the next folder in a flow after Execute Command.

The Switch Script file is set up something like this. It is invoked each time a new job arrives:

Code: Select all

Function jobArrived(s, job)

	Set shell = CreateObject("WScript.Shell")
	shell.CurrentDirectory = "\\servername\directory_where_bat_file_exits"
	shell.Run "mybatfile.bat"

	'Send job to next flow element
	job.sendToSingle(job.getPath())

 End Function
Post Reply