>Except that stupid run command not work!
>
>This is the original idea (in Delphi, but is enough simple for work in any language, like VFP!):
>
http://homepages.borland.com/efg2lab/Library/UseNet/1999/0424a.txt>
>This is the code:
>
>CR=CHR(13)+CHR(10)
>
>lcFile=CR+CR+'n'
>lcBatch='CD C:\'+CR+'format A: /Q
> +'del resp.txt del %0'
>
>dele file c:\resp.txt
>dele file c:\formatear.bat
>STRTOFILE(lcFile,'c:\resp.txt')
>STRTOFILE(lcBatch,'c:\formatear.bat')
>
>run c:\formatear.bat
>
>This generate two files: A .bat file to run the format disk and a text file for the response from the user, but without user!
>
>All work fine, except because the las line "run..." don't work (the bat file is not run)..
>
>I work in a Win XP Pro machine (this is a problem?)
>
>Exist other way to run a Dos command(and maybe in hide mode)
>
>Enjoy this simple rutine...if the las line work!
RUN CMD /C c:\formatear.bat
RUN COMMAND /C c:\formatear.bat
Alternately, you could use Ed Rauh's API_APPRUN class (available for download here) to run the batch file "invisibly".
There are probably better ways to do it by directly calling the appropriate Windows API function but I don't know which one off the top of my head.
Just found an example (in Spanish) on the Web: http://profesort.galeon.com/html/articulo/apivfp/ejemplo2.html
Regards. Al
"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov
Neither a despot, nor a doormat, be
Every app wants to be a database app when it grows up