Hi Alan,
Thanks for this much needed hint on the obvious way to go.  Moreover, I had
even given several DevCon talks about controlling the PC with the shell
object etc, but that was many years ago. But I might have known :(
Seems I'm getting really old :(

wOOdy


-----Ursprüngliche Nachricht-----
Von: ProFox <[email protected]> Im Auftrag von Alan Bourke
Gesendet: Montag, 4. Dezember 2023 10:10
An: [email protected]
Betreff: Re: ChdkDsk from VFP

You could skin it a different way and use WMI:

strComputer = "."
objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" +
strComputer +"\root\cimv2") 
objDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='D:'")
errReturn = objDisk.ChkDsk(.f.)      && or .t. to fix errors
? errReturn

I believe the return codes etc are as described here:
https://learn.microsoft.com/en-us/previous-versions/windows/desktop/vdswmi/c
hkdsk-method-in-class-win32-volume



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to