Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Reading the ErrorLevel code from Batch File...


Reading the ErrorLevel code from Batch File...

Author
Message
Kimblegray
Kimblegray
Forum Member
Forum Member (76 reputation)Forum Member (76 reputation)Forum Member (76 reputation)Forum Member (76 reputation)Forum Member (76 reputation)Forum Member (76 reputation)Forum Member (76 reputation)Forum Member (76 reputation)Forum Member (76 reputation)

Group: Forum Members
Posts: 2, Visits: 3
Hi All,



I'm looking example in VB2010 example which able to run chkdsk d: /f and the code will able to read the errorlevel code return from chkdsk.



I'm trying using .exitcode but it is not a errorlevel code return from chkdsk.



Appreciate you can help...



Thanks.



Regards,

Kimbleray

I'm newbie need more hard work on VB coding...
zack
zack
Forum God
Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)Forum God (1.3K reputation)

Group: Forum Members
Posts: 102, Visits: 110
This may help. Check out https://msdn.microsoft.com/en-us/library/windows/desktop/aa384913%28v=vs.85%29.aspx>



The VB code near the bottom returns the error code:



Const FIX_ERRORS = True



strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")



Set objDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='D:'")



errReturn = objDisk.ChkDsk(FIX_ERRORS) 'Returns error code

Edited
4/1/2016 by zack
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search