Page 1 of 1
> character in parameters of "Run Program"
Posted: Thu Mar 19, 2015 9:59 pm
by dbortunk
I have a run program task which runs an exe named adfind.exe . I need to run parameters with this exe but one of them contains the > character and causes problems. It will not run the program correctly when that character is present. The parameters are C:\Apps\AdFind\adfind.exe -f "&(objectcategory=person)(objectclass=user)" pager samaccountname -nodn -nocsvheader -noctl -csvnoq -csv>c:\apps\adfind\INTList.csv
Anyone know why it doesnt work or how to make it work?
Re: > character in parameters of "Run Program"
Posted: Fri Mar 20, 2015 11:19 am
by Oleg
The string
">c:\apps\adfind\INTList.csv" is NOT a parameter
This means that you redirect output stream to the file
c:\apps\adfind\INTList.csv
Your command line is:
C:\Apps\AdFind\adfind.exe -f "&(objectcategory=person)(objectclass=user)" pager samaccountname -nodn -nocsvheader -noctl -csvnoq -csv
What action do you use?
If it is
Run Program/Open Document you should use second copy of command processor (CMD.EXE)
Use this command line:
cmd.exe /c C:\Apps\AdFind\adfind.exe -f "&(objectcategory=person)(objectclass=user)" pager samaccountname -nodn -nocsvheader -noctl -csvnoq -csv>c:\apps\adfind\INTList.csv
Also I recommend you to try the action
Run Command-Line Utility and use the command line
C:\Apps\AdFind\adfind.exe -f "&(objectcategory=person)(objectclass=user)" pager samaccountname -nodn -nocsvheader -noctl -csvnoq -csv
This action allows to catch the output text into variable. You can save the text later into a file.
Re: > character in parameters of "Run Program"
Posted: Fri Mar 20, 2015 3:16 pm
by dbortunk
I tried to add the CMD /c to the command and use the command line utility option but both error out when i try it. The run program task errors if i put anything after the cmd.exe /c . If i leave cmd.exe /c byt itself it opens a command prompt fine but it wont allow any options
Re: > character in parameters of "Run Program"
Posted: Fri Mar 20, 2015 4:34 pm
by Oleg
It seems you wrote all parameters in "Program/Document name" field.
See screenshot below

- commandline.png (53.88 KiB) Viewed 17182 times