HumperHard Posted March 3, 2009 Share Posted March 3, 2009 How come this wont work? $FileList=_FileListToArray("C:\Documents and Settings\","*",2) ;;search this folder for any folders within If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf ;_ArrayDisplay($FileList,"$FileList") For $x = 1 to $FileList[0] Switch $FileList[$x] Case "LocalService" ;; users to ignore Case "NetworkService" ;; users to ignore Case "root" ;; users to ignore Case Else ;; process all other users MsgBox(1,"","Found: " & $FileList[$x]) EndSwitch Next Link to comment Share on other sites More sharing options...
Developers Jos Posted March 3, 2009 Developers Share Posted March 3, 2009 Works fine here.... what doesn't work for you? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Danny35d Posted March 3, 2009 Share Posted March 3, 2009 It work in my computer windows xp pro sp3. The only thing I added at the begging was #include <File.au3> AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Link to comment Share on other sites More sharing options...
HumperHard Posted March 3, 2009 Author Share Posted March 3, 2009 Works fine here.... what doesn't work for you? Well maybe its the rest of my code that it doesnt work with. I need it to list the user accounts that have profiles already created for them (ie. they have been logged into before). expandcollapse popup#include <Array.au3> #Include <File.au3> ; ######################################################################################### ; # Progress Bar ; ######################################################################################### ProgressOn ( "Account Creation", "IA Tool Kit" ) $UserName = ("IATester") $Password = ("Password") ProgressSet ( 10 ) ; ######################################################################################### ; # List users on the computer that have profiles created ; ######################################################################################### $oMyError = ObjEvent("AutoIt.Error","MyErrFunc"); Install a custom error handler Local $objDomain = ObjGet("WinNT://" & @ComputerName & "" ) Dim $filter[2] = ["user"] $objDomain.Filter = $filter $aaUser = "" For $aUser In $objDomain ;$aaUser = $aaUser & $aUSer.Name & " | " & $aUSer.Description & @LF & @LF $aaUser = $aaUser & @CR & $aUSer.Name & ": " & $aUSer.Description & @CR & "__________________________________________________________" & @CR Next ;Beep(500, 100) MsgBox(4112, "List of Users", $aaUser) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $FileList=_FileListToArray("C:\Documents and Settings\","*",2) ;;search this folder for any folders within If @Error=1 Then MsgBox (0,"","No Files\Folders Found.") Exit EndIf ;_ArrayDisplay($FileList,"$FileList") For $x = 1 to $FileList[0] Switch $FileList[$x] Case "LocalService" ;; users to ignore Case "NetworkService" ;; users to ignore Case "root" ;; users to ignore Case Else ;; process all other users MsgBox(1,"","Found: " & $FileList[$x]) EndSwitch Next ;COM Error function Func ComError() If IsObj($oMyError) Then $HexNumber = Hex($oMyError.number, 8) ConsoleWrite($oMyError.scriptline & ' $HexNumber = ' & $HexNumber & "Windescription is: " & $oMyError.description & "|" & $oMyError.windescription & @lf);### Debug Console SetError($HexNumber) Else SetError(1) EndIf Return 0 EndFunc ;==>ComError ProgressSet ( 30 ) ; ######################################################################################### ; # Create IATester account ; ######################################################################################### $strComputer = @ComputerName $colAccounts = ObjGet("WinNT://" & $strComputer & "") $objUser = $colAccounts.Create("user", $UserName) $objUser.SetPassword ($Password) $objUser.Put ("Fullname", "IATester") $objUser.Put ("Description", "IA Testing Account") $objUser.SetInfo ProgressSet ( 70 ) ; ######################################################################################## ; # Add IATester to Administrator and Auditors ; ######################################################################################## $objGroup = ObjGet("WinNT://" & $strComputer & "/Administrators") $objGroup.Add("WinNT://"&$UserName) $objGroup = ObjGet("WinNT://" & $strComputer & "/Auditors") $objGroup.Add("WinNT://"&$UserName) ProgressSet ( 100 ) ; ######################################################################################## ; # Force logout ; ######################################################################################## ;shutdown (0) Link to comment Share on other sites More sharing options...
Developers Jos Posted March 3, 2009 Developers Share Posted March 3, 2009 (edited) before even starting to look at the code: What part works for you and what doesn't work? EDIT: Guess your issue is that your MSGBOX is located behind the progress window. Edited March 3, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
HumperHard Posted March 3, 2009 Author Share Posted March 3, 2009 before even starting to look at the code: What part works for you and what doesn't work?The only part that doesnt work it displaying the profiles..... if I take that piece out it works fine. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 3, 2009 Developers Share Posted March 3, 2009 check my edit of the previous post SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
HumperHard Posted March 3, 2009 Author Share Posted March 3, 2009 (edited) check my edit of the previous post LOL... how do I change that msgbox to pop up some where else?edit: nevermind.. I know how to fix...... thanks Edited March 3, 2009 by HumperHard Link to comment Share on other sites More sharing options...
HumperHard Posted March 3, 2009 Author Share Posted March 3, 2009 I did.. I did... Link to comment Share on other sites More sharing options...
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