Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Format Disk using FoxPro Command?
Message
From
04/07/1999 19:42:10
 
 
To
04/07/1999 18:17:39
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00237325
Message ID:
00237386
Views:
12
>>>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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform