Jump to content

ksmith247

Active Members
  • Posts

    273
  • Joined

  • Last visited

About ksmith247

  • Birthday 01/30/1970

Profile Information

  • Location
    Atlanta, GA. USA
  • Interests
    Forever n00b!

ksmith247's Achievements

Universalist

Universalist (6/7)

0

Reputation

  1. Once again I tip my hat to you, sir. Thank you.
  2. I'm drawing a blank here. I need to use the Set command to create an environmental variable before using USMT to migrate user data. I want to put together a small AutoIt script to run SET MIG_IGNORE_PROFILE_MISSING=1 and then launch USMT. For the life of me I cant get SET MIG_IGNORE_PROFILE_MISSING=1 to work. Using EnvSet() won't work and all attempts to use Run with @ComSpec have failed. I'm obviously not thinking about this from the proper perspective.
  3. With over 10,000 devices on my domain I was quick to kill the enumeration. I like the idea though.
  4. I had a similar problem with Internet Explorer. I needed to watch for a particular instance if IE to be closed and when it was closed, relaunch to a particular URL. Look up WinWaitActive() and WinGetHandle(). Launch Wordpad with Run() and then use WinWaitActive() for your instance to appear. Use $Handle = WinGetHandle() to grab the handle of that particular instance and assign it to a variable. Then you can wait for that variable to no longer exist or simply sleep while it does exist, whatever. This is what I wound up with for IE. AutoItSetOption("TrayIconHide", 1) While 1 = 1 Run(@ProgramFilesDir & "Internet ExplorerIEXPLORE.EXE http://connection.mypage.com/departments/Ops/tewp", "", @SW_MAXIMIZE) WinWaitActive("http://connection.mypage.com") ; Hard coded page title here $Handle = WinGetHandle("http://connection.mypage.com") ; And here While WinExists($Handle) Sleep(5000) WEnd WEnd
  5. Try RunWait(@ComSpec & " /k winmgmt /verifyrepository" , ""). This way the cmd prompt sticks around and doesn't run hidden. Maybe it can give you more insight. Just curious, if you are running the command with @SW_hide, where are you seeing the results? How are you capturing the 8007007e error?
  6. Have you tried putting this line only in it's own script and running it from there? Are you trying to scan the backup that you are making or the active WMI repository? Perhaps you left out the 'Wait' portion of RunWait on another line and you're trying to hit the repository with two commands at once. I had no trouble with the above line running on my Win7 machine.
  7. After several hours of beating my head against the wall I found my own answer. I moved from using PIDs and ProcessExists to WinGetHandle and WinExists. This allows for watching the individual instance of IE that the script calls despite the process itself still being active. Maybe this can help someone else.
  8. I have a similar issue to what Aktonius described here... I have a script that launches IE to a particular portal page. When that page is closed, the script will kill off some other executables that are running and then relaunch the webportal page. All of this works just fine provided that there is only one instance of IE running, If a user decides to open another IE instance, the original instance becomes the parent process and all other instances become children of the original. If the user then closes the original window, the process is still running (as the parent) even though the visible IE window is closed. (This fails when using ProcessExists to identify the PID of Internet Explorer) This whole thing baffled me until I watched Process Explorer while running the script. Does anyone have any ideas how to accomplish this?
  9. There is absolutely no way I would have ever arrived here. Thank you for your time and to rcmaehl too.
  10. It's not much but something I puled from an old script. It does however look in WMI at QFE and display all installed patches. #include <array.au3> $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("Select HotFixID from Win32_QuickFixEngineering") $message = "HotFixes Installed on " & @ComputerName & @CRLF & "-------" & @CRLF For $objItem In $colItems $message &= $objItem.HotFixID & @CRLF Next MsgBox(64, "Results", $message) I have read the Array Wiki; it just doesn't compute for me. Again, I am probably making it more difficult (in my head) than it has to be. On a side note, this is the first time the #include in my signature has actually worked.
  11. I have a rather involved AutoIT script that is used to update/patch XP computers in an off network situation. We have been rolling out Windows 7 for a while and I need to start patching these guys too; however XP and 7 are quite different in relation to security updates. In XP I was able to read HKLM\software\Microsoft\Windows\Currentversion\Uninstall to determine the existence of a security update or hotfix (hereafter referred to as patch). If the script found the KB number in the registry then the patch is already installed and it skipped to the next patch. This is not an option in Windows 7 and WMI seems to be the best place to get what I am looking for. I know in Win32_QuickFixEngineering there is a property called HotFixID. I think I need to read this and dump it into an array, search the array and if the search is positive skip installing the particular patch (searching for KB255987 for example). I am having major trouble getting WMI data into an array. I have read the array wiki and searched through the forums. I am also pretty sure that I am making it much more confusing than it should be but I just can't seem to wrap my head around this one. A nudge in the right direction would be most appreciated.
  12. @kylomas - duh... I wish Jon would make AutoIt do what I want it to, not what I tell it to. Thank you. @wolf9228 - Is there some advantage to undertaking this task in the manner you have described? I'm not opposed to it but it looks a bit confusing.
  13. So I have looked at the help file and searched through the forum and find myself still scratching my head. Here is an idea of what I am trying to do ; Shows the filenames of all files in the current directory. $search = FileFindFirstFile("C:\*.txt") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $t = FileGetTime($file) $yyyymd = $t[0] & $t[1] & $t[2] If $yyyymd = @YEAR & @MON & @MDAY Then MsgBox(0, $t, "Same") Else MsgBox(0, $t, "Different " & $t) EndIf WEnd ; Close the search handle FileClose($search) It's a mashup of FileFindFirst/Next and FileGetTime. I want to search a directory for files with a particular extension, then if found check the date. If the file was modified today I will copy it to another location (though above I just have a msgbox.) What am I missing? As always, thanks in advance. It has been quite a while since I have posted, I like the new forum look.
  14. I had an old link to LxP's PDF in my signature that I hadn't thought about in a couple of years until I ran across it on my PC today. I decided to check for updates as people at work are always asking me for help. Imagine my surprise! Well done Brett! This will make my life easier
×
×
  • Create New...