I am trying to use the command line piping “>” to capture the output into a text file, then do some processing later. But somehow, execute program does not even create the text file.
I am using Execute Program action:
hello.exe
Parameters: /param > report.txt
Anything i missed?
Thanks
Hi Sherry,
Redirecting output with > is actually a DOS shell feature, so you have two options:
1) Use the ‘Run DOS Command’ action to run the executable, including the redirect.
2) Use the ‘Log to Variable’ option on the Execute Program action, and then use the Write To Text File action to write out the variable contents.
Hth.
We’re having a similar problem: we’re trying to redirect Subversion output by using a basic ‘Run DOS Command’ because redirection (>) is not possible with the ‘Subversion Generic’ action: svn propget svn:externals “%source%” > "%TEMP%\externals.txt"
Simply using ‘svn’ or a full path to the svn executable is not really desired and we didn’t find out how to get the ‘Subversion Binaries Location’ configuration from the options by scripting, there doesn’t seem to be a ‘Subversion as OptionsName’ for GetOptionsObject.
Also, when putting log output to a variable and then writing that to a file as Angus Gratton suggested, you get not only the output but also undesired extra lines in the beginning and the end of the output file (SVN Parameters etc.)…
Either it should be possible to
A) put log output to a variable with the option to put ONLY real output into it (preferably!)
B) or offer the subversion binaries location for scripting
Hi Tom,
The options should be exposed to scripting… that is a bug.
I’ve just fixed it and will do a new build today.
.t8
Here’s the new build:
https://www.finalbuilder.com/downloads/finalbuilder/410/FB410_256.exe
Thanks for the quick response and the new release!
I’m quite surprised by the speed this bug fix was applied!
After a lot of trial and error, this seems to work (tSvn is a FB project variable):
Dim sSvnOptions
Set sSvnOptions = GetOptionsObject(“Subversion (SVN)”)
tSvn = sSvnOptions.SubversionLocation() & “\svn.exe”
great! glad it's sorted :)
.t8