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

RUN Command WITH XP

Status
Not open for further replies.

ChrisMc

Programmer
Apr 24, 2002
43
0
0
GB
I first saw this routine posted by (I think) Steven S and it works fine under the Win9x family. Under XP it fails because START.EXE no longer exists. Does anybody have a solution for XP (and I presume all the NT family)?

Thanks in advance,
ChrisMc

cFile = SYS(2023) + SYS(3) + '.URL'
IF FILE(m.cFile)
ERASE (m.cFile)
ENDIF
nFh = FCREATE(m.cFile)
IF m.nFH < 0
WAIT &quot;Can't create a temporary file for the email&quot; WINDOW NOWAIT
RETURN
ENDIF
= FPUTS(m.nFH,'[InternetShortcut]')
= FWRITE(m.nFH,'URL=mailto:' + cURL)
= FWRITE(m.nFH,'?subject=Enter subject')
= FFLUSH(m.nFH)
= FCLOSE(m.nFH)

RUN /N2 START &cFile
RETURN .T.
 
ChrisMc

There must something else at play, because if I use the above code in VFP7.0 on XP, it brings up an Outlook message with the information filled in the appropriate places.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike

Thanks for responding - how the heck is yours working? I've searched my XP installation for START.EXE (or .COM)and it doesn't exist. It *does* exist on both a WinMe machine and a Win98 machine so my assumption was that it is not part of XP. There's no reference in the help files to a replacement.
Out of interest, was your XP installation an upgrade? I can see it being left over in those circumstances.

Thanks again
Chris
 
Further info: I copied START.EXE from a WinMe machine and it will run on the XP machine and does indeed start the default email client BUT it first starts as a DOS EXE and blanks the screen for 1+ seconds. Very anoying.

I'm looking at alternatives - the most obvious is to use an API call to determine the location of the default email client but I can't track down what calls are available using RegFn and CallFn in Foxtools - The notes say they are in the SDK documentation and I don't have that. MS KnowledgeBase only seems to deal with the latest release (not unreasonable I suppose). Does any have any further info?

Thanks to all
Chris
 
I had to experiment quite a bit with a way to send an email with an attachment through FPD26. After doing a bunch of searches all over the net, and try the different things that came up, what I found that works for myself is to call the .url file like this:

RUN c:\cmd.exe /c start c:\sendmail.txt

I don't see a DOS window poping up. if it does, it must be awfully quick because I don't even see it blink... :)

cheers,

Realm174
 
FYI.. The start command does exist in Windows XP. It is part of CMD.EXE, so you must be running a DOS window and type the command in from there. I use it here to start a Win32 application in the middle of a batch file for overnight processing. The correct syntax (From the command line) is START /W <WinApp.Exe>. the /W will cause the command processor to wait until the Win32 app exits.
-Ron
 
RLG: When I try that without the cmd.exe, it won't work for me tho... bad command or filename is what I get..

Realm174
 
First, thanks to all for the input.
I don't know whether the START.EXE we had in Win9x & ME is replaced in XP or not. I appreciate that some have it available but the fact that some machines don't have it makes it impossible for me to continue with the approach I had adopted. I'm therefore going to write an external EXE to handle my calls consistently; if this is flexible and usable by others, I'll make it public domain and post a link here.
ChrisMc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top