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 profox-bounces@leafe.com Im Auftrag von Alan Bourke Gesendet: Montag, 4. Dezember 2023 10:10 An: profoxtech@leafe.com 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