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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why can't I use 'Run'...

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,343
FR
Hi All,

Here's an odd one, I have several projects - some in VFP 6 and some still in VFP 5.

The finished compiled executables all work fine - using the 'Run' command to run simple external commands (such as Zip or mailsend).

When I run them from with VFP, they mostly work fine - except the 'Run' commands never execute!

I've been living with it for ages - and just thought today "Hey someone on Tek-Tips will probably know why!"

TIA


Regards

Griff
Keep [Smile]ing
 
Hi Griff,

Use Shellexecute instead of RUN command. It will work fine. Search for shellexecute you will find lot of tips in this forum.

 
Hi,

I use shellexecute for most things, there's just a few things that I still use a run command for - any idea why they don't work in the VFP interactive shell?

Regards

Griff
Keep [Smile]ing
 
Griff,

I don't know why your particular RUNs don't work, but in general I prefer to avoid the RUN command now. I often have trouble with it; I find ShellExecute() much more satisfactory.

Mike


Mike Lewis
Edinburgh, Scotland
 
Griff

I use some 'quirky' command line utilities and should they not behave with ShellExecute(), I programatically create a .bat file, rememember those halcyon days [smile], and use ShellExecute() with final parameter of 0, or alternatively CreateProcess() in a similar fashion.

Seems to beat the little critters into submission [hammer]

FAQ184-2483 - the answer to getting answered.​
Chris [pc2]
 
Hi Guys,

Actually these run command do execute batch files - I think I still use them because the programs they run return DOS error levels.

They all work fine in compiled programs - it's only when the same apps are run from within the IDE that they are problematic!

Still, I can cope - just thought perhaps one of you had come across the same thing!

I'm off to look for a command line phone dialer!

Regards

Griff
Keep [Smile]ing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top