Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Clipper "RUN" command.

Status
Not open for further replies.

Rahja

Programmer
Mar 4, 2007
16
CA
I am trying to call a batch file from within my clipper app to execute the printing of a crystal report. The batch file is called "Report.bat" and it contains one line as follows
"cviewbatch11.exe @mycommands.txt"
The text file just passes some printing parameters to the exe file. The process works fine when I type "Report" at the DOS command shell prompt. But when I call it from within my clipper app as "Run Report" it calls the cviewbatch11.exe @mycommands.txt and then issues a "BAD COMMAND OR FILENAME".
I already use this calling of batch files to run NET USE functions and they work fine, I do not understand why the Bad Command is being issued.
Any guidance will be greatly appreciated!
 
It sounds like Clipper can't 'see' your executable at runtime - the "net use" commands would be visible regardless of where your current directory was, but your executable may not be.

Try being specific in the run command - if in doubt, use a batch file with a different name (report probably being a reserved word) and put the path to the report in the command - and the path to the executable in the batch file:

Code:
run c:\mybats\reptrunner.bat
Code:
c:\myreportprogs\cviewbatch11.exe @c:\myreportprogs\mycommands.txt



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Thanks Griff!

Tried your suggestion. Renamed Report.bat to MyRep.bat
edited it to read:

d:\flaman\cviewbatch11.exe @d:\flaman\mycommands.txt

Same thing happens. Works fine from the Command Prompt gives
my a "Bad Command or File Name" when I run the command
"Run MyRep.bat" from within my Clipper App.

Brian
 
Can your application see myrep.bat though?

Try being specific about the call

RUN c:\flaman\myrep.bat


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Thanks again Griff! Got it figured out, sometimes it's hard
to see the forest for the trees! Even though it ran fine if
I called it from the Command prompt, Clipper must obviously call an older version of a DOS Shell as it would not recognize the Long-File Name "cviewbatch11.exe", I renamed the exe to just "cview.exe" and away it went. You were definetly on the right track, if not for your suggestions I would most likely still be trying to figure it out.

Thanks Again!
 
No problem, glad to help.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top