r4b1dm0nk3y Posted March 14, 2012 Author Share Posted March 14, 2012 (edited) I don't see any violation here. This is not in reference to a forum or site auto-login, nor is this a SPAM application/tool. Edited March 14, 2012 by r4b1dm0nk3y Link to comment Share on other sites More sharing options...
Developers Jos Posted March 14, 2012 Developers Share Posted March 14, 2012 I don't see any violation here. This is not in reference to a forum or site auto-login, nor is this a SPAM application/tool.Agree 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...
r4b1dm0nk3y Posted March 14, 2012 Author Share Posted March 14, 2012 (edited) I found a simple way to accomplish what I need to do. It's not as 'elegant' or 'sexy' as the if, then, else method but it works. I can tell the script to use key commands to lock the console then do the commands to unlock and stop the access protection feature, then lock the console. If I tell it to always run the lock command first it works whether the console is already locked or unlocked. I don't know why I didn't think to try that earlier. Is there a way to keep the script from pausing when a key is presse or mouse moved? Even when using BlockInput() if a key is pressed or mouse moved the script pauses, worst of all the machine controls are still locked when that happens. Working code: expandcollapse popup; ---- Detect System OS Architecture ---- ; This section check if the OS is running x86 or x64 bit Windows. If the machine detect x86 or x64 OS it will execute ; commands for that Windows version. x86 will execute programs from C:Program Files and x64 will execute ; programs from C:Program Files (x86). Switch @OSArch Case "x86" ; Do stuff for x86 _x86() Case "x64" ; Do stuff for x64 _x64() Case Else MsgBox(16, "Error", "Unhandled case: CPU architecture not recognized." & @CRLF & "Please notify your system administrator!") Exit EndSwitch Func _x86() ; ---- Disable McAfee Access Protection ---- ; This section will run McAfee VirusScan Console to disable Access Protection via program ; execution, then using keyboard (ALT + <key>) #region ---Au3Recorder generated code Start --- Opt("WinWaitDelay",100) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) BlockInput(1) Run('C:Program FilesMcAfeeVirusScan Enterprisemcconsol.exe') _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console if it is unlocked _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}on{ALTUP}") ; Unlocks console _WinWaitActivate("Login","The user interface i") Send("<password_here>") ; Enters password to unlock console _WinWaitActivate("VirusScan Console","") Send("{F4}{ALTDOWN}{F4}{ALTUP}") ; Stops highlighted feature _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console BlockInput(0) #region --- Internal functions Au3Recorder Start --- #endregion --- Internal functions Au3Recorder End --- #endregion --- Au3Recorder generated code End --- EndFunc ;==>_x86 Func _x64() ; ---- Disable McAfee Access Protection ---- ; This section will run McAfee VirusScan Console to disable Access Protection via program ; execution, then using keyboard (ALT + <key>) #region ---Au3Recorder generated code Start --- Opt("WinWaitDelay",100) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) BlockInput(1) Run('C:Program Files (x86)McAfeeVirusScan Enterprisemcconsol.exe') _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console if it is unlocked _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}on{ALTUP}") ; Unlocks console _WinWaitActivate("Login","The user interface i") Send("<password_here>") ; Enters password to unlock console _WinWaitActivate("VirusScan Console","") Send("{F4}{ALTDOWN}{F4}{ALTUP}") ; Stops highlighted feature _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console BlockInput(0) #region --- Internal functions Au3Recorder Start --- #endregion --- Internal functions Au3Recorder End --- #endregion --- Au3Recorder generated code End --- EndFunc ;==>_x64 Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc Edited March 14, 2012 by r4b1dm0nk3y Link to comment Share on other sites More sharing options...
Mechaflash Posted March 15, 2012 Share Posted March 15, 2012 So you don't have to create 2 functions for this, add this at the top of the script: #AutoIt3Wrapper_UseX64=N And just change Run('C:Program Files (x86)McAfeeVirusScan Enterprisemcconsol.exe') To Run(@ProgramFilesDir & 'McAfeeVirusScan Enterprisemcconsol.exe') So you only have to make one function and call it from each case. Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
r4b1dm0nk3y Posted March 15, 2012 Author Share Posted March 15, 2012 (edited) If I use #AutoIt3Wrapper_UseX64=N the script is compiles for x86 correct? If so do I even need to detect the architecture then? If I'm referencing the same function in each 'case' its kind of superfluous it seems. Also, the windows variable %programfiles% opens "c:program files" regardless of OS architecture (not "c:program files (x86)" on a x64 machine), wouldn't the same thing happen with the @ProgramFilesDir variable? Or would @ProgramFilesDir be similar to using %programfiles% on x86 machines and %programfiles(x86)% on x64 machines? Edited March 15, 2012 by r4b1dm0nk3y Link to comment Share on other sites More sharing options...
Blue_Drache Posted March 15, 2012 Share Posted March 15, 2012 I don't think you can set compiler directives in an if/then switch block ... can you? If I'm not mistaken, the compiler really doesn't care about the conditionals, since only when you execute the code the if/then blocks are read. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 15, 2012 Moderators Share Posted March 15, 2012 Blue-Drache,You are correct. All #directives are honoured before any parsing of the script so they cannot be made conditional. Which is rather a pity but far too dificult to implement short of a total rewrite of the core code which is not happening soon, if ever. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
r4b1dm0nk3y Posted March 15, 2012 Author Share Posted March 15, 2012 (edited) I don't understand what that means. Does this mean that using " #AutoIt3Wrapper_UseX64=N" would not be of benefit to use in my script? Edit: Nevermind about above question. I figured out what you guys were talking about. Edited March 15, 2012 by r4b1dm0nk3y Link to comment Share on other sites More sharing options...
Mechaflash Posted March 15, 2012 Share Posted March 15, 2012 (edited) My use would be to cut down your code. expandcollapse popup#AutoIt3Wrapper_UseX64=N ; ---- Detect System OS Architecture ---- ; This section check if the OS is running x86 or x64 bit Windows. If the machine detect x86 or x64 OS it will execute ; commands for that Windows version. x86 will execute programs from C:Program Files and x64 will execute ; programs from C:Program Files (x86). Switch @OSArch Case "x86" ; Do stuff for x86 _DisableMcAfeeAccessProtection() Case "x64" ; Do stuff for x64 _DisableMcAfeeAccessProtection() Case Else MsgBox(16, "Error", "Unhandled case: CPU architecture not recognized." & @CRLF & "Please notify your system administrator!") Exit EndSwitch Func _DisableMcAfeeAccessProtection() ; ---- Disable McAfee Access Protection ---- ; This section will run McAfee VirusScan Console to disable Access Protection via program ; execution, then using keyboard (ALT + ) #region ---Au3Recorder generated code Start --- Opt("WinWaitDelay",100) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) BlockInput(1) Run(@ProgramFilesDir & 'McAfeeVirusScan Enterprisemcconsol.exe') _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console if it is unlocked _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}on{ALTUP}") ; Unlocks console _WinWaitActivate("Login","The user interface i") Send("") ; Enters password to unlock console _WinWaitActivate("VirusScan Console","") Send("{F4}{ALTDOWN}{F4}{ALTUP}") ; Stops highlighted feature _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console BlockInput(0) #region --- Internal functions Au3Recorder Start --- #endregion --- Internal functions Au3Recorder End --- #endregion --- Au3Recorder generated code End --- EndFunc ;==>_DisableMcAfeeAccessProtection Hell, if you have no other use for discovering if its x64 or x86 other than trying to access Program Files (x86), you can remove your switch/case. #AutoIt3Wrapper_UseX64=N ; ---- Disable McAfee Access Protection ---- ; This section will run McAfee VirusScan Console to disable Access Protection via program ; execution, then using keyboard (ALT + ) Opt("WinWaitDelay",100) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) BlockInput(1) Run(@ProgramFilesDir & 'McAfeeVirusScan Enterprisemcconsol.exe') _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console if it is unlocked _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}on{ALTUP}") ; Unlocks console _WinWaitActivate("Login","The user interface i") Send("") ; Enters password to unlock console _WinWaitActivate("VirusScan Console","") Send("{F4}{ALTDOWN}{F4}{ALTUP}") ; Stops highlighted feature _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console BlockInput(0) Edited March 15, 2012 by mechaflash213 Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
r4b1dm0nk3y Posted March 15, 2012 Author Share Posted March 15, 2012 Yeah, I understand that, what I didn't understand was what Blue_Drache and Melba23 were saying, but I got it now. @ProgramFilesDir does not work for what I need to do on x64 machines. @ProgramFilesDir references "c:program files" on both x86 and x64 machines. I am not able to use that function because I need to reference "c:program files" and "c:program files (x86)" on x86 and x64 respectively. Link to comment Share on other sites More sharing options...
Mechaflash Posted March 15, 2012 Share Posted March 15, 2012 (edited) 4th from top by Guinness. I figured it would work =/.From what he states, if #AutoIt3Wrapper_UseX64=N, @ProgramFilesDir should return C:Program Files (x86) on an x64 Edited March 15, 2012 by mechaflash213 Spoiler “Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.” Link to comment Share on other sites More sharing options...
r4b1dm0nk3y Posted March 15, 2012 Author Share Posted March 15, 2012 I tested it out and doesn't work that way. I have the #AutoIt3Wrapper_UseX64=N declaration and with @ProgramFilesDir the script would not runon an x64 machine. I could define the variables as guinness did and that might do the the trick. Func _ProgramFilesDir() Local $ProgramFileDir Switch @OSArch Case "X32" $ProgramFileDir = "Program Files" Case "X64" $ProgramFileDir = "Program Files (x86)" EndSwitch Return @HomeDrive & "" & $ProgramFileDir EndFunc ;==>_ProgramFilesDirh Link to comment Share on other sites More sharing options...
guinness Posted March 15, 2012 Share Posted March 15, 2012 This works >> #AutoIt3Wrapper_UseX64=N ;~ This will return C:Program Files (x86) on x64 and C:Program Files on x86. MsgBox(4096, "", @ProgramFilesDir)Or could you explain in clear details the results you want. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
r4b1dm0nk3y Posted March 16, 2012 Author Share Posted March 16, 2012 I'll give it another try. It hasn't worked for me in the past. I've added a section to uninstall an agent then loop to check when the completion notice comes up and close it out so the script can continue. That seems to be working fine but my key stroke actions, which happen after the loop, to unlock the console don't work anymore. The console will appear and then it looks like the commands are all sent at once but nothing happens (I can see the alt key being pressed, then the menus looks like its "strobes" superfast). I'm not sure how else to explain it. Can you look at my code and see if you can find anything wrong with it?expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=C:UsersStaffDownloadsepo (2).ico #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; --- Change log --- Version 2 --- ; v1 - Detect OS archirecture then execute function. Setup keypresses to unlock interface ; v2 - Setup script to deltect if console is locked or unlock, then choose action to complete process. ; v2.2 - Fixed if..elseif..else syntax issues ; v2.4 - Experiment with ControlCommand() parameters ; v2.6 - Experiment with ControlGetText(), WinMenuSelectItem() and ControlFocua() commands ; v2.8 - Removed if..elseif..else statement and added keypresses to lock the console first. This fixed the initial issue where the script hangs if console is ; already unlocked. Added BlockInput()command to avoid user input stopping the script in process ; v3 - Added commands to uninstall McAfee ePO Agent ; v3.2 - Added loop to check when McAfee Agent is finished uninstalling, Added "Opt("TrayAutoPause", 0)" to stop script from auto pausing. ; v3.4 - Added "Return 0" or "ExitLoop" to exit ePO "While 1" loop, otherwiswe the script never ends ; ; ; ---- Detect System OS Architecture ---- ; This section check if the OS is running x86 or x64 bit Windows. If the machine detect x86 or x64 OS it will execute ; commands for that Windows version. x86 will execute programs from C:Program Files and x64 will execute ; programs from C:Program Files (x86). Opt("TrayAutoPause", 0) ; Stops script from auto pausing Opt("TrayIconDebug", 1) ; Output's debug info BlockInput(1) ; Lock keyboard and mouse inputs to avoid interference Switch @OSArch Case "x86" ; Do stuff for x86 _x86() Case "x64" ; Do stuff for x64 _x64() Case Else MsgBox(16, "Error", "Unhandled case: CPU architecture not recognized." & @CRLF & "Please notify your system administrator!") Exit EndSwitch Func _x86() ; Code to be executed on x86 machines #region ---Au3Recorder generated code Start --- Opt("WinWaitDelay",100) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) ; ---- Uninstall McAfee ePO Agent ---- ; This section will uninstall McAfee ePO Agent via program ; execution, then use keyboard (Enter) to close completion dialogue Run('"C:Program FilesMcAfeeCommon Frameworkfrminst.exe" /forceuninstall') ; Runs McAfee ePO agent uninstall While 1 ; Loop until window appears If WinExists("McAfee Agent", "OK") Then _WinWaitActivate("McAfee Agent","") Send("{ENTER}") ; Closes the "McAfee Agent Setup completed successfully" dialogue Sleep (100) ExitLoop Else Sleep (100) EndIf WEnd ; ---- Disable McAfee Access Protection ---- ; This section will run McAfee VirusScan Console to disable Access Protection via program ; execution, then using keyboard (ALT + <key>) Run('C:Program FilesMcAfeeVirusScan Enterprisemcconsol.exe') ; Opens McAfee console _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console if it is unlocked _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}on{ALTUP}") ; Unlocks console _WinWaitActivate("Login","The user interface i") Send("<password_here>") ; Enters password to unlock console _WinWaitActivate("VirusScan Console","") Send("{F4}") ; Stops highlighted feature _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}{F4}{ALTUP}") ; Closes McAfee Console #region --- Internal functions Au3Recorder Start --- #endregion --- Internal functions Au3Recorder End --- #endregion --- Au3Recorder generated code End --- EndFunc ;==>_x86 Func _x64() ; Code to be executed on x64 machines #region ---Au3Recorder generated code Start --- Opt("WinWaitDelay",100) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) ; ---- Uninstall McAfee ePO Agent ---- ; This section will uninstall McAfee ePO Agent via program ; execution, then use keyboard (Enter) to close completion dialogue Run('"C:Program Files (x86)McAfeeCommon Frameworkfrminst.exe" /forceuninstall') ; Runs McAfee ePO agent uninstall While 1 ; Loop until window appears If WinExists("McAfee Agent", "OK") Then _WinWaitActivate("McAfee Agent","") Send("{ENTER}") ; Closes the "McAfee Agent Setup completed successfully" dialogue Sleep (100) ExitLoop Else Sleep (100) EndIf WEnd ; ---- Disable McAfee Access Protection ---- ; This section will run McAfee VirusScan Console to disable Access Protection via program ; execution, then using keyboard (ALT + <key>) Run('C:Program Files (x86)McAfeeVirusScan Enterprisemcconsol.exe') ; Opens McAfee console _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console if it is unlocked _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}on{ALTUP}") ; Unlocks console _WinWaitActivate("Login","The user interface i") Send("<password_here>") ; Enters password to unlock console _WinWaitActivate("VirusScan Console","") Send("{F4}") ; Stops highlighted feature _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}ol{ALTUP}") ; Locks console _WinWaitActivate("VirusScan Console","") Send("{ALTDOWN}{F4}{ALTUP}") ; Closes McAfee Console #region --- Internal functions Au3Recorder Start --- #endregion --- Internal functions Au3Recorder End --- #endregion --- Au3Recorder generated code End --- EndFunc ;==>_x64 Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc BlockInput(0); Unlock keyboard and mouse inputsOn another front, I need to check if the agent is installed. I want to try to do that by opening a file and checking for a string.. If present execute agent uninstall else unlock console using the run and while = 1 sections from above.I need to read "C:ProgramDataMcAfeeCommon FrameworkSiteList.xml" then check for "epo_server" Any ideas? I know I need to use _FileReadArray(). I started out with this code but it keeps erroring out. Msgbox responds with 0, so I take it the string is not being found.#include <File.au3> Dim $aResult Global $File = "C:ProgramDataMcAfeeCommon FrameworkSiteList.xml" If Not _FileReadToArray($File, $aResult) Then MsgBox(4096, @ScriptName, "There was an error reading file!") Exit EndIf For $x = 1 To $aResult[0] $Result = StringInStr($aResult[$x], "epo_server", 0) MsgBox(0, @ScriptName, $Result) Next ; Uninstall script here EndIf WEndThanks to all for your help and input this far. Link to comment Share on other sites More sharing options...
r4b1dm0nk3y Posted March 19, 2012 Author Share Posted March 19, 2012 (edited) @guinness, I copied the code directly as you put, saved it and ran the script. My MsgBox output was "C:Program Files" on Win7 x64 SP1 machine. Edited March 19, 2012 by r4b1dm0nk3y Link to comment Share on other sites More sharing options...
guinness Posted March 19, 2012 Share Posted March 19, 2012 Do you have SciTE4AutoIt3? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
r4b1dm0nk3y Posted March 19, 2012 Author Share Posted March 19, 2012 (edited) After much searching, trial and error, I figured out how to read a file then execute task. My script is working well except the key commands on the console portion. The script key commands work on my machine(compiled as .exe), but not on on the test machine of the same architecture (compiled as .exe). The console opens, then the ALT key is pressed and that seems about it. Any ideas what the problem could be? Edited March 19, 2012 by r4b1dm0nk3y Link to comment Share on other sites More sharing options...
r4b1dm0nk3y Posted March 19, 2012 Author Share Posted March 19, 2012 Yes, I have SciTE4AutoIt3. Link to comment Share on other sites More sharing options...
Developers Jos Posted March 19, 2012 Developers Share Posted March 19, 2012 What does the SciTE Help/About tell you ? It is either "SciTE" or "SciTE-Lite". 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...
r4b1dm0nk3y Posted March 19, 2012 Author Share Posted March 19, 2012 SciTE Version 2.27 Jun 24 2011 17:46:25 by Neil Hodgson. Updated: Valik & Jos 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