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!

Run Windows App From Clipper

Status
Not open for further replies.

dlpastel

Programmer
Aug 8, 2002
114
US
I am trying to run a windows app called txttopdf.exe from a a Clipper application. My clipper program reads the line of code:
Run ("C:\Utility\txttopdf.exe")
but nothing happens.
So I tried just to open a dos window by writing a program with only one line:
Run "C:\Winnt\System32\cmd.exe"
and no dos window opened.
Any ideas how to call a app from a clipper program?
 
I assume you checked the paths, ofcourse, but this indeed is a way to run external tools, including Windows apps. Must be some permissions stuff, can't see from here, sorry.

HTH
TonHu
 
Hi, dlpastel

I think what you want to do in this case is use the START command rather than invoking the windows program directly.

Most likely the windows app is failing to start for some reason and immediately terminating, so you don't see anything happen. By using start, possibly with the /separate option you will be running the app in its own window and address space which will enable it to start up or if not at least you may see the crash.

BTW, I am assuming it does work when you type C:\Utility\txttopdf.exe at the command prompt in the same folder in which you are executing the clipper program.

Use START /? at the CMD prompt for syntax and list of options.

The reason shelling to cmd didn't work ...

1. you didn't give cmd anything to do, and no /k to stay resindent so it terminates when finished. Very short run.
Try:

xCmd := 'start "New Window" cmd /k "echo Hello World"'
run &xCmd

2. Or ... maybe it did - the dos prompt would look the same, are you sure you weren't at the second command prompt? It would not have redisplayed the copyright or cleared the screen etc.

Jock
 
I use the Blinker SWPRUNCMD.

Under Windows XP:
swpruncmd("cmd /c start ssrpt32 " + ::INIFile, 0, "", "")

Under all other windows since 95:
swpruncmd( "SSRPT32 " + ::INIFile, 0, "", "")

The difference is that XP will lock the DOS app until the windows app completes unless you use the special method.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top