yejier Posted July 8, 2007 Posted July 8, 2007 (edited) sorry,I'm poor in English,I have a trouble with "objget" and "for...in...next". ' VBScript。 Set LoginProfiles = GetObject("winmgmts:").InstancesOf ("Win32_NetworkLoginProfile") for each Profile in LoginProfiles WScript.Echo Profile.Name WScript.Echo Profile.LastLogon next 'au3. $loginprofiles=ObjGet("winmgmts:Win32_NetworkLoginProfile") ;MsgBox(0,"",$loginprofiles) For $profile In $loginprofiles ;MsgBox(0,"",$loginprofiles) $text=String($profile.Name) MsgBox(0,"", $text) ;MsgBox(0,"", $profile.LastLogon) ;MsgBox(0,"",objname($loginprofiles)) Next but, why $profile.Name have no value? Edited July 8, 2007 by yejier
MisterBates Posted July 8, 2007 Posted July 8, 2007 sorry,I'm poor in English,I have a trouble with "objget" and "for...in...next".'au3.$loginprofiles=ObjGet("winmgmts:Win32_NetworkLoginProfile");MsgBox(0,"",$loginprofiles)For $profile In $loginprofiles ;MsgBox(0,"",$loginprofiles) $text=String($profile.Name) MsgBox(0,"", $text) ;MsgBox(0,"", $profile.LastLogon) ;MsgBox(0,"",objname($loginprofiles))Nextbut, why $profile.Name have no value?On my PC, ubound($loginprofiles) reports zero entries - your call to ObjGet is not returning anything. Take a look at a post by resnullis in this thread. It may help ... [u]MisterBates[/u]_____________________________________________________Suspend/Resume Windows ScreensaverWatchWindows - Window watcher/loggerUDF: Click systray menu/submenu itemsUDF: Outlook Express Folder/Message handling (+ example code)HowTo: Multiple icons in one compiled script
yejier Posted July 8, 2007 Author Posted July 8, 2007 if you use objname($loginprofiles) before for....in....next will return value but between in for...in..next objname($loginprofiles) have no value
yejier Posted July 10, 2007 Author Posted July 10, 2007 $strComputer = "localhost" $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\cimv2") $colItems = $objWMIService.ExecQuery("Select * from Win32_NetworkLoginProfile") For $objItem in $colItems MsgBox(0, 0, $objItem.Name) MsgBox(0, 0, $objItem.LastLogon) Next
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now