bourny Posted August 15, 2008 Posted August 15, 2008 I am new to WMI and am struggling to get Autoit to return what I can do in .VBS I need to pull a list of all local user users on the machien the scriot runs on I can do this in the following .vbs but cannot figure how to translate this into AutoIT All I want to do is put the result of users into a string seperated by a comma. Hope someone can help VB Script **************************** Dim objFileSystem, objOutputFile Dim strOutputFile ' generate a filename base on the script name strOutputFile = "c:\localUsers.txt" Set objFileSystem = CreateObject("Scripting.fileSystemObject") Set objOutputFile = objFileSystem.CreateTextFile(strOutputFile, TRUE) Set objNetwork = CreateObject("Wscript.Network") strComputer = objNetwork.ComputerName Set colAccounts = GetObject("WinNT://" & strComputer & "") colAccounts.Filter = Array("user") For Each objUser In colAccounts objOutputFile.WriteLine(objUser.Name ) Next objOutputFile.Close Set objFileSystem = Nothing
weaponx Posted August 15, 2008 Posted August 15, 2008 http://www.autoitscript.com/forum/index.ph...++accounts++wmi
bourny Posted August 15, 2008 Author Posted August 15, 2008 http://www.autoitscript.com/forum/index.ph...++accounts++wmiThanks... - That works fine Could you help me understand by explaining the "ObjGet("WinNT://" & @ComputerName & "" )"I am using VBSEdit to browse all the WMI objects and I cannot find which Object the @ComputerName matches..... It obviously is not listed in the WMI objects.??Where can I find this object listed as it appears it holds an array of all users. It probably also holds information on other things ...
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