Jump to content

archgriffin

Active Members
  • Posts

    58
  • Joined

  • Last visited

About archgriffin

  • Birthday 04/26/1980

Profile Information

  • Location
    Michigan, USA

archgriffin's Achievements

Wayfarer

Wayfarer (2/7)

1

Reputation

  1. Well if it didn't have to be entirely automatic you could do FileOpenDialog or FileSelectFolder. Probably not what you are looking for but thought they should be referenced just in case.
  2. This is apparently due to the way cmd /c or /k handles quotes, see http://www.computerhope.com/cmd.htm for more information on that. To "fix" it, try the following: $programlocation = "c:\program files\app\app.exe" $filetoprocess = "c:\program files\app\data.txt" $output = "c:\program files\app\output.txt" Run(@ComSpec & ' /k ""' & $programlocation & '" options "' & $filetoprocess & '" > "'&$output&'""') Notice the double quoting, since the first and last characters are getting stripped, this would "preserve" them. So note, it is not a limitation of AutoIt, just the way cmd.exe works.
  3. Maybe use _FileListToArray to put all the files in an array, then put each in to an array according to the file name length, use _ArraySort to sort them then walk through them either to a single array, or a text file or something. Alternatively maybe have something find the longest file name, and then "pad" the rest to match it. Would be best with a regular expression to compare it to (finding the last numerical digit and adding 0s in front of it). But I'm rather horrible at regex. I also bet there are better ideas then those, its just what I could think of from the top of my head. edit: too slow...
  4. Not having installed those silently, I'm not sure what their parameters are. But you can try opening a command window and putting a /? a /h -h --help or something similar after the install file to see if it lists parameters. If any of them are MSI files, then you can use the MSIEXEC command options. Google or the applications website should have the information you seek. Search for a list of silent install or silent deployment options. I think Notepad++ is /S for silent installs.
  5. I normally do #3, but its a specific folder that is shared exactly for that purpose, though I am normally using it to uninstall things.
  6. What does the information from the Au3Info (normally located -> c:\Program Files\AutoIt3\Au3Info.exe) say?
  7. Unfortunately I think you are stuck on this. There are only two working switches and they are /detectnow and /resetauthorization. Granted I am not a WSUS admin, but I spent most of the other day working with ours, and he was telling me you can get it to download updates with the detectnow, but t will not install anything until the specified time. If I am wrong, someone else please give the answer as I would like to know this too.
  8. I believe, you are looking for _ArrayAdd, but that will only add the data so if you are using [0] to store the number of elements, then you would probably want to Ubound it, or just add as you go which ever you find easier. But also what WideBoyDixon said would also be wise about using another array.
  9. Out of curiosity wouldn't the function _FileWriteLog work for what you need? Of course creating your own function for it gives you more control if needed.
  10. For some reason, I don't think this is right. Depending on your sysprep, a new GUID is created during the mini-setup, without knowing what the machine USED to be called and manually entering that some where, I don't think you can search for it because the GUIDs should never match. We just edit our sysprep.ini file either after imaging with the computer name we want, or just give it an invalid name in the sysprep.ini, then during the mini-setup it will ask you to name the machine saying it is invalid. Also using the adfunctions.au3 might save you some time in playing with AD: http://www.autoitscript.com/forum/index.ph...st&p=583830 Then again I honestly may just be wrong, prehaps I'll read this again and try to think of another response later if this was of no help now.
  11. Well for physical machine installs you can use Nlite (www.nliteos.com) that can do most of the automated things for you just to get a plain XP install. You could install XP the way you want manually, with software then use something like Acronis, Ghost, DriveImage XML, Clonezilla or other imaging software, to make an image of it then deploy it to future virtual machines. I have not used VirtualBox since SUN took it over, my work got a copy of VMWare Workstation. I believe this is the tutorial I used to make my VMWare templates: http://www.virtual-strategy.com/Migration/...e-Template.html I would imagine that VirtualBox would allow a similar procedure. Then again maybe it is as simple as copying all the files, and doing a File-> Open Virtual Machine. There are many ways to go about it, anything more specific you are looking for?
  12. I believe he is right about the COM error coming from the use of the Recursive group finding. You can also get COM errors however if you do not have rights to remove people from the group. In the script I use it would give the error, but continue trying to remove the user from the other groups.
  13. From what you wrote I believe you are trying to remove a single user from every group they are a member of in AD. Here is a script I started as part of a end user termination script that might be helpful. #include-once #include "includes\adfunctions.au3" #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) $mainwindow = GUICreate("Find Users Groups", 200, 80) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked") GUICtrlCreateLabel("Username: ", 15, 10, 100, 20) $sUser = GUICtrlCreateInput("", 70, 10, 100, 18) $sGoBut = GUICtrlCreateButton("Get List",40, 40, 100) GUICtrlSetOnEvent($sGoBut, "_List_Groups") GUISetState(@SW_SHOW) While 1 Sleep(1000) ; Idle around WEnd Func _List_Groups() If Not _ADObjectExists(GUICtrlRead($sUser)) Then MsgBox (0, "Invalid", "The username: " & GUICtrlRead($sUser) & " is not valid.") Else _ADGetUserGroups($loggedonusergroups, GUICtrlRead($sUser) ) Run("notepad") For $CompanyADGroup IN $loggedonusergroups $sADAttributes = StringSplit($CompanyADGroup, ",") $sGroupName = StringSplit($sADAttributes[1], "=") $sGroup = $sGroupName[2] WinWait("[TITLE:Untitled - Notepad]", "") If Not WinActive("[TITLE:Untitled - Notepad]", "") Then WinActivate("[TITLE:Untitled - Notepad]", "") WinWaitActive("[TITLE:Untitled - Notepad]", "") ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", $sGroup) ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", "{ENTER}") If $sGroup <> "Domain Users" Then _ADRemoveUserFromGroup($CompanyADGroup, _ADSamAccountNameToFQDN(GUICtrlRead($sUser))) Next ControlSend("Untitled - Notepad", "", "[CLASS:Edit; INSTANCE:1]", "{ENTER}") EndIf EndFunc Func CLOSEClicked() Exit EndFunc It asks for a username, then if it can find it in AD, opens notepad and types in the group, and removes the user from it. Primitive I know, but I got pushed to other projects so the overall script is on hold. Hope this helps.
  14. That seemed out of place. He is trying to help but we need more information of what is going on to figure out why the issue occurs. I am a little confused myself. It sounds like what weaponx said, that you have multiple installers going off at once, and there are different ways that could happen. Are you having nlite run these installers all separately? If so, then why not script them all, and have nlite just call a single autoit script that does them each in turn? Also according to the autoit help file: WinExists = Checks to see if a specified window exists. WinWait = Pauses execution of the script until the requested window exists. One checks to see if a window is there at all then just moves on, the other pauses and waits for a window to appear, then continues after a timeout.
  15. If you use the ADfunctions you could use ADAddUserToGroup for adding users to groups.
×
×
  • Create New...