Jump to content

Script works on Win 7 but not on Win 10

Recommended Posts

Found here in forum this small script to get some info from the local hard disk.

Works fine on Win 7 but not on Win 10

Any ideas?

Dim $sResult
$strComputer = "."
$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_DiskDrive")

For $objItem In $colItems
    $HDInfos = $objItem.Caption
    $HDGroesse = Int($objItem.Size / 1024 ^ 3)

MsgBox(64, $ScriptName, "HD Infos: " & $HDInfos)
MsgBox(64, $ScriptName, "Grösse: " & $HDGroesse)



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...