>>>Can i format disk using FoxPro Command?
>>
>>You can run the command line format command using VFP's RUN command, or using any of a number of API calls such as ShellExecute() or CreateProcess() - my API_APPRUN class uses the CreateProcess() API call.
>>
>>The simple example, using VFP to format a disk in the A: drive:
>>
>>RUN FORMAT A: /Q/U
>
>I'd rather go the API way here, because I've had bad experience with running the DOS Format under Windows (even version 7.1, which ships with W95 OSR2, and also with W98), because in some environments it simply freezes the task that calls it - be it Fox or a separate Dos window. Happened on three different machines in six months (and would still be happening, but we rather taught the users how to click their way through).
API_APPRUN does this with no problems; You can use LaunchApp() and test to see when it finishes with CheckProcessExitCode(), and if you think it died, can kill it with the KillProc() method. You still need to create an appropriate .PIF for FORMAT as I remember (right click on FORMAT in Explorer, select Properties, and under Program, check the Close on Exit box) to get it to shut down completely without user intervention when format completes. You can redirect STDIN (use < to pipe a script, or modify the STDIN Handle of the structure passed describing the process to create) to bypass al user intervention.