Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fast without user interaction, format function, except..
Message
De
24/05/2002 18:48:51
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00661270
Message ID:
00661275
Vues:
16
This message has been marked as the solution to the initial question of the thread.
>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!
*Win NT/2K/XP:
RUN CMD /C c:\formatear.bat
* Win9x/Me:
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform