- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I am trying to run my compiled application (compiled with IVF 11.1) via the Win API Shell function.
The command line that I use with the Shell function is something like:
"d:\AppPath\CIRCLY32.EXE" @ 1>"D:\DataPath\JobName.sto" 2>&1
The task executes OK, except that there is no stdout file ("D:\DataPath\JobName.sto") created.
If I run the same command line from a command prompt the correct stdout file is created.
I'm puzzled!!!
Regards,
Leigh
I am trying to run my compiled application (compiled with IVF 11.1) via the Win API Shell function.
The command line that I use with the Shell function is something like:
"d:\AppPath\CIRCLY32.EXE" @ 1>"D:\DataPath\JobName.sto" 2>&1
The task executes OK, except that there is no stdout file ("D:\DataPath\JobName.sto") created.
If I run the same command line from a command prompt the correct stdout file is created.
I'm puzzled!!!
Regards,
Leigh
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Leigh Wardle
Hi all,
I am trying to run my compiled application (compiled with IVF 11.1) via the Win API Shell function.
The command line that I use with the Shell function is something like:
"d:AppPathCIRCLY32.EXE" @ 1>"D:DataPathJobName.sto" 2>&1
The task executes OK, except that there is no stdout file ("D:DataPathJobName.sto") created.
If I run the same command line from a command prompt the correct stdout file is created.
I'm puzzled!!!
Regards,
Leigh
I am trying to run my compiled application (compiled with IVF 11.1) via the Win API Shell function.
The command line that I use with the Shell function is something like:
"d:AppPathCIRCLY32.EXE" @ 1>"D:DataPathJobName.sto" 2>&1
The task executes OK, except that there is no stdout file ("D:DataPathJobName.sto") created.
If I run the same command line from a command prompt the correct stdout file is created.
I'm puzzled!!!
Regards,
Leigh
You may want to try embedding this string in an additional set of quotes - sometimes the quote characters get stripped off and the string executed isn't what you expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - David White
You may want to try embedding this string in an additional set of quotes - sometimes the quote characters get stripped off and the string executed isn't what you expected.
Thanks, David.
I tried embedding this string in an additional set of quotes.
But that made the Shell function return TaskID=0 - meaning the task did not start.
Regards,
Leigh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Could you elaborate on "Win API Shell function". Are you referring to ShellExecute?
The redirection that you are chasing is normally performed by cmd.exe, hence it "works" from a command prompt. Perhaps the API that you are calling does not invoke your program via cmd.exe or perform its own redirection processing. Try something along the lines of:
cmd.exe /c "d:AppPathCIRCLY32.EXE" @ 1>"D:DataPathJobName.sto" 2>&1
as the program to invoke (perhaps cmd.exe as the file with the rest, including the /c, as the parameters, depending on the particular API you are calling). Comments about requiring additional quotes (particularly around your original command line) may apply here as well.
For light entertainment or further debugging, consider temporarily putting a call to the F2003 intrinsic GET_COMMAND in your program and writing the resulting command argument out to a file. If it contains the redirection bits then you know that the command line for your call is not being processed as you want by whatever api you are calling.
The redirection that you are chasing is normally performed by cmd.exe, hence it "works" from a command prompt. Perhaps the API that you are calling does not invoke your program via cmd.exe or perform its own redirection processing. Try something along the lines of:
cmd.exe /c "d:AppPathCIRCLY32.EXE" @ 1>"D:DataPathJobName.sto" 2>&1
as the program to invoke (perhaps cmd.exe as the file with the rest, including the /c, as the parameters, depending on the particular API you are calling). Comments about requiring additional quotes (particularly around your original command line) may apply here as well.
For light entertainment or further debugging, consider temporarily putting a call to the F2003 intrinsic GET_COMMAND in your program and writing the resulting command argument out to a file. If it contains the redirection bits then you know that the command line for your call is not being processed as you want by whatever api you are calling.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - IanH
Could you elaborate on "Win API Shell function". Are you referring to ShellExecute?
The redirection that you are chasing is normally performed by cmd.exe, hence it "works" from a command prompt. Perhaps the API that you are calling does not invoke your program via cmd.exe or perform its own redirection processing. Try something along the lines of:
cmd.exe /c "d:AppPathCIRCLY32.EXE" @ 1>"D:DataPathJobName.sto" 2>&1
as the program to invoke (perhaps cmd.exe as the file with the rest, including the /c, as the parameters, depending on the particular API you are calling). Comments about requiring additional quotes (particularly around your original command line) may apply here as well.
For light entertainment or further debugging, consider temporarily putting a call to the F2003 intrinsic GET_COMMAND in your program and writing the resulting command argument out to a file. If it contains the redirection bits then you know that the command line for your call is not being processed as you want by whatever api you are calling.
The redirection that you are chasing is normally performed by cmd.exe, hence it "works" from a command prompt. Perhaps the API that you are calling does not invoke your program via cmd.exe or perform its own redirection processing. Try something along the lines of:
cmd.exe /c "d:AppPathCIRCLY32.EXE" @ 1>"D:DataPathJobName.sto" 2>&1
as the program to invoke (perhaps cmd.exe as the file with the rest, including the /c, as the parameters, depending on the particular API you are calling). Comments about requiring additional quotes (particularly around your original command line) may apply here as well.
For light entertainment or further debugging, consider temporarily putting a call to the F2003 intrinsic GET_COMMAND in your program and writing the resulting command argument out to a file. If it contains the redirection bits then you know that the command line for your call is not being processed as you want by whatever api you are calling.
Combining cmd.exe /c and additional quotes (underlined below) around my original command worked!
That is:
cmd.exe /c ""d:AppPathCIRCLY32.EXE" @ 1>"D:DataPathJobName.sto" 2>&1"
Many thanks to IanH and David White for your help.
Regards,
Leigh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Leigh,
As an extention to this, keep in the back of your mind that you can additionally use START. Start is particularly handy when you want to launch multiple concurrent processes.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - IanH
For light entertainment or further debugging, consider temporarily putting a call to the F2003 intrinsic GET_COMMAND in your program and writing the resulting command argument out to a file. If it contains the redirection bits then you know that the command line for your call is not being processed as you want by whatever api you are calling.
Just for the record, GET_COMMAND now returns "d:AppPathCIRCLY32.EXE" @
So it leaves off the redirection bits...
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page