I have a flow that is assembling a job folder consisting of 2 files and building a Windows batch file (.bat) to run from within the job folder.
I am able to get everything together, but I am having trouble running the batch file.
The batch file runs from the command prompt perfectly.
I am using the RUN command, but it is deleting the job folder. The Execute Command does not allow me to run the file dynamically.
The Execute Command Friend application documentation is outdated.
I need to preserve the job folder and output the command produces.
Does anyone have any ideas how I can do this?
Executing Windows Batch file (.bat)
- JimmyHartington
- Advanced member
- Posts: 460
- Joined: Tue Mar 22, 2011 7:38 am
Re: Executing Windows Batch file (.bat)
Can you share your bat script? This would make it a bit easier to help troubleshoot.
I have had some flow, where I "cd" into a folder in a bat file and do the processing.
Perhaps this is possible here.
I have had some flow, where I "cd" into a folder in a bat file and do the processing.
Perhaps this is possible here.
- JimmyHartington
- Advanced member
- Posts: 460
- Joined: Tue Mar 22, 2011 7:38 am
Re: Executing Windows Batch file (.bat)
It could then look like the flow below.
2 arbitrary files are assembled into a jobfolder.
The "Run Command" app cds into the directory and runs a command to create an empty file.
This is created in the job-folder.
2 arbitrary files are assembled into a jobfolder.
The "Run Command" app cds into the directory and runs a command to create an empty file.
This is created in the job-folder.
Re: Executing Windows Batch file (.bat)
Hi and thank you for your help!
This is my flow. I am creating a .bat for each job using the "Create file from template" app and private data and placing that .bat in the job folder Below is the .bat file that is needed to run
What i am trying to do is use Beyond Compare to compare approx. 400 text files. I can only run one at a time, but they run in 1 or 2 seconds. The flow is using the job name as the job folder name, so maybe what i can do is keep the job folder name the same, then i can use your idea to CD into it and run the .bat file, which will always be the same name.
Tell me what you think. Thank you very much
This is my flow. I am creating a .bat for each job using the "Create file from template" app and private data and placing that .bat in the job folder Below is the .bat file that is needed to run
What i am trying to do is use Beyond Compare to compare approx. 400 text files. I can only run one at a time, but they run in 1 or 2 seconds. The flow is using the job name as the job folder name, so maybe what i can do is keep the job folder name the same, then i can use your idea to CD into it and run the .bat file, which will always be the same name.
Tell me what you think. Thank you very much
- JimmyHartington
- Advanced member
- Posts: 460
- Joined: Tue Mar 22, 2011 7:38 am
Re: Executing Windows Batch file (.bat)
Is the order of the text files important in bat-file?
Because otherwise I think this could be done without the need to create a bat file and make the run command more universal.
If you want I could give it a crack by downloading a Beyond Compare trial and make a flow.
Because otherwise I think this could be done without the need to create a bat file and make the run command more universal.
If you want I could give it a crack by downloading a Beyond Compare trial and make a flow.
Re: Executing Windows Batch file (.bat)
Yes the order is important because you have to compare the original to the newer version of the file.
But I did change things with the RUN command.
I am trying to run the commandline without a batch file and had some success. This is the what i am doing with the RUN command:
"C:\Program Files\Beyond Compare 4\BCompare.exe" @D:\Testing\BC4\MISC\BC-MAG_COMPARE.txt "[Job.Path]\[Job.PrivateData:Key="Before"]" "[Job.Path]\[Job.PrivateData:Key="After"]" "[Job.Path]\outhtml"
It kinda worked. The compare ran successfully, i think the RUN command it deleting the job folder. BC4 produces a log file and that is the only left after the RUN command and the outgoing folder.
But I did change things with the RUN command.
I am trying to run the commandline without a batch file and had some success. This is the what i am doing with the RUN command:
"C:\Program Files\Beyond Compare 4\BCompare.exe" @D:\Testing\BC4\MISC\BC-MAG_COMPARE.txt "[Job.Path]\[Job.PrivateData:Key="Before"]" "[Job.Path]\[Job.PrivateData:Key="After"]" "[Job.Path]\outhtml"
It kinda worked. The compare ran successfully, i think the RUN command it deleting the job folder. BC4 produces a log file and that is the only left after the RUN command and the outgoing folder.
- JimmyHartington
- Advanced member
- Posts: 460
- Joined: Tue Mar 22, 2011 7:38 am
Re: Executing Windows Batch file (.bat)
Try changing the command to this:
This way the command should go into the job folder. Then you can reference the filenames as you do with Private Data Key "Before" and "After".
And the "out.html" should be created in the job folder.
Are the Private Data Key "Before" and "After" set correctly earlier in the flow?
Code: Select all
cd "%%InputFilePath%%" && "C:\Program Files\Beyond Compare 4\BCompare.exe" @D:\Testing\BC4\MISC\BC-MAG_COMPARE.txt "[Job.PrivateData:Key="Before"]" "[Job.PrivateData:Key="After"]" "out.html"
And the "out.html" should be created in the job folder.
Are the Private Data Key "Before" and "After" set correctly earlier in the flow?
Re: Executing Windows Batch file (.bat)
Have you tried running the batch file through an intermediate script (e.g. PowerShell or VBScript) to control the execution environment? I'm wondering if the RUN environment itself is doing a cleanup after it finishes without preserving the job folder?
Re: Executing Windows Batch file (.bat)
Hello,
I got it working.
Ended up using the app "Create File From Template" and built my batch file with it.
First I make a copy of the job folder, then run the batch file, it send output to the BC4_temp folder. The "Run Command" sends the job folder on to "Folder 12", why I do not know, but this works for me.
Thank you for your help!
I got it working.
Ended up using the app "Create File From Template" and built my batch file with it.
First I make a copy of the job folder, then run the batch file, it send output to the BC4_temp folder. The "Run Command" sends the job folder on to "Folder 12", why I do not know, but this works for me.
Thank you for your help!
- JimmyHartington
- Advanced member
- Posts: 460
- Joined: Tue Mar 22, 2011 7:38 am
Re: Executing Windows Batch file (.bat)
Glad you got it to work.