>>>>>Hi
>>>>>
>>>>>I have a program that creates a batch file, then runs it, but I want to set the batch file properties to Close on exit - can I do this from VFP?
>>>>>
>>>>>Thanks
>>>>>Kev
>>>>
>>>>Kevin,
>>>>Doesn't it close by default ?
>>>>
>>>>
create cursor myCommands (commstr c(128))
>>>>insert into myCommands values ('c:')
>>>>insert into myCommands values ('cd \fpd26')
>>>>insert into myCommands values ('dir')
>>>>insert into myCommands values ('foxprox')
>>>>copy to mybatch.bat type delimited
>>>>StrToFile(chrtran(FileToStr('mybatch.bat'),'"',''),'mybatch.bat')
>>>>run 'mybatch.bat'
Cetin
>>>
>>>Whilst on the subject of the RUN Command. I have changed the Foxrun.PIF settings to Close on exit and run minimized, yet whenever I use RUN it runs as a NORMAL window.
>>>
>>>Do you know why this is?
>>>Thanks
>>>Kev
>>
>>No I don't Kevin, sorry.
>>I almost never use Run command but ShellExecute instead.
>>Cetin
>
>Ok, will ShellExecute solve my problem?
>
>Kev
I think so. ie:
declare long ShellExecute in "shell32.dll" ;
long hwnd, string lpszOp, ;
string lpszFile, string lpszParams, ;
string lpszDir, long nShowCmd
ShellExecute(0,'','c:\fpd26\foxprox.exe','mytest.prg','c:\fpd26',0)
Launches foxpro DOS, which in turn runs myTest.Prg all behind the scenes.
MyTest.prg simply has these lines :
handle=fcreate('hello.txt')
=fputs(handle,"Hello kid. Don't forget to call your grandpa.")
=fclose(handle)
quit
Cetin