Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


bbusse
2013-01-14T19:21:16Z
We use IBM's Connect:Direct for Windows via the command line to submit 'NDM' jobs that transfer files from one platform to another. Previously i've been using batch files, which is fine, but I am trying to be more dynamic by using variables within VisualCron.

Here's an example of a line in a batch file that we'd use:

d:\Apps\CDSDK\Direct.exe < \\server\share\inputcommand.cdp

That 'inputcommand.cdp' could be named whatever, and its just a list of instructions for the NDM server to perform. So, using a Process Execute task, I'd do the following:


Working Directory:   D:\Apps\CDSDK\Direct.exe
Arguments:           < \\server\share\inputcommand.cdp


This does not work. When submitted, I get the following error, which is unique to the program but still means its not being interpreted properly:

*************************************************
The following error has occurred:
While processing the command line, '<' was encountered, but a '/' or a '-' was expected.

However, if I use a batch file or anything else that calls that command exactly as I originally listed it, it works just fine:


d:\Apps\CDSDK\Direct.exe < \\server\share\inputcommand.cdp


Currently running VC 6.1.4 on Server 2008 R2.

All other execute tasks work just fine with arguments. Its this one not liking however VC is passing those arguments. That, or it just doesn't like the <

Brian
Sponsor
Forum information
Support
2013-01-14T19:28:15Z
Hi,

if you need to use redirect operators you should try to uncheck (in main settings):

- store standard output
- store standard error

Also, if this does not help you should also check "Use shell execute".

The first two takes over redirection of output so that VisualCron can capture output. By unchecking VisualCron gives away control.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2013-01-14T19:35:36Z
Originally Posted by: Support 

Hi,

if you need to use redirect operators you should try to uncheck (in main settings):

- store standard output
- store standard error

Also, if this does not help you should also check "Use shell execute".

The first two takes over redirection of output so that VisualCron can capture output. By unchecking VisualCron gives away control.




Neither of those options work. I can get around it by using a Powershell task and just put this as the code:


cmd /c "D:\Apps\CDSDK\Direct.exe < \\server\share\inputcommand.cdp"


But obviously i'd like to not involve powershell for something like this. So, its not critical, but i'd love to know why its blowing up when using an execute task.

Brian
Support
2013-01-14T20:09:23Z
Try placing the whole string in the command and nothing in argument.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2013-01-14T21:24:23Z
Originally Posted by: Support 

Try placing the whole string in the command and nothing in argument.



VC doesn't let you do that. Its expecting an exact path to an Executable file and gives an error:

"The Job could not be started because the file could not be found. Please check the path."


Brian
Support
2013-01-14T22:43:20Z
Originally Posted by: bbusse 

Originally Posted by: Support 

Try placing the whole string in the command and nothing in argument.



VC doesn't let you do that. Its expecting an exact path to an Executable file and gives an error:

"The Job could not be started because the file could not be found. Please check the path."


Brian



I know this works < and >. Let me give you an example tomorrow.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2013-01-14T22:45:42Z
This doesn't work (first screenshot), you get the error message (2nd screenshot):

EDIT: And I do realize the \\server\share is not real, i replaced my real server name for example purposes.
bbusse attached the following image(s):
Support
2013-01-14T22:53:58Z
What if you create a batch file that you write your command and argument in?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2013-01-16T11:47:18Z
Ok, I found the answer. File redirection is a part of cmd.exe. What you need to do is the following, for example:

Command line: c:\windows\system32\cmd.exe
Argument: /c c:\sourcefiles\test\outtest.exe > c:\outoutout.txt
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
bbusse
2013-01-16T13:45:18Z
Originally Posted by: Support 

Ok, I found the answer. File redirection is a part of cmd.exe. What you need to do is the following, for example:

Command line: c:\windows\system32\cmd.exe
Argument: /c c:\sourcefiles\test\outtest.exe > c:\outoutout.txt




That ended up working. Thanks Henrik! I 'really' doubt hardly anyone else is using a program like this so this should be a rarity :)

I just didn't want to involve another language to execute a dos command (Powershell or .NET task), so this works perfectly for me now.

Brian
Scroll to Top