Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all 12506 articles
Browse latest View live

need help with a click in a fcn.

$
0
0

   how can i make the mouse click with the coordinate? it have to be in one fcn. the mouse click have to be in this order so i cant make another fcn. im very new to this. 

-snip-

Really Special Charactes in label (√/←/...)

$
0
0

I want to have the Square Root () and an Arrow (←) character in a label. But when I copy and paste them from the Windows Character Map, the arrow turns into a question mark and the square root into a 'v'. How can I have those special characters in labels / buttons / anywhere in AutoIt?

 

Thank you very much

Script Not Un-Pausing

$
0
0

Hello First let me say thank you for any help you can provide. This script installs powershell and all its dependencies. The problem i am having is that i think RunWait isnt working correctly or it is and i wrote it wrong.  The Script is  not un pausing itself.  Can anyone let me know what i am doing wrong here? Should i even be using that command?

AutoIt         
  1. $osv = @OSVersion
  2. $ost = @OSArch
  3.  
  4. Local $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\PowerShellEngine\", "PowerShellVersion")
  5. Local $var2 = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\","Version")
  6.  
  7.  
  8.         Case "WIN_2008"
  9.  
  10.          If @OSArch = "x86" Then
  11.  
  12.                If $var <> "1.0" Then
  13.  
  14.                     $CMD = "C:\Temp\dotNetFramework\dotnetfx35setup.exe /q /norestart"
  15.                        RunWait(@comspec & " /k " & $CMD)
  16.                     Sleep (60000)
  17.  
  18.                     $CMD = "C:\Temp\BITS\x86.msu  /quiet /norestart"
  19.                        RunWait(@comspec & " /c " & $CMD)
  20.                     Sleep (60000)
  21.  
  22.                     $CMD = "C:\Temp\WMF\x86.msu  /quiet /norestart"
  23.                        RunWait(@comspec & " /c " & $CMD)
  24.  
  25. MsgBox(0, "", "Done")
  26.  
  27.  
  28.                Else
  29.  
  30.                     $CMD = "ServerManagerCmd.exe -remove PowerShell -restart"
  31.                         RunWait(@comspec & " /k " & $CMD)
  32.                     Sleep (60000)
  33.  
  34.                     $CMD = "C:\Temp\dotNetFramework\dotnetfx35setup.exe /q /norestart"
  35.                        RunWait(@comspec & " /k " & $CMD)
  36.                     Sleep (60000)
  37.  
  38.                     $CMD = "C:\Temp\BITS\x86.msu  /quiet /norestart"
  39.                        RunWait(@comspec & " /c " & $CMD)
  40.                     Sleep (60000)
  41.  
  42.                     $CMD = "C:\Temp\WMF\x86.msu  /quiet /norestart"
  43.                        RunWait(@comspec & " /c " & $CMD)
  44.  
  45. MsgBox(0, "", "Done")
  46.  
  47.  
  48.                EndIf
  49.  
  50.          ElseIf @OSArch = "x64" Then
  51.  
  52.  
  53.            MsgBox(0, "", "64 Bit Win 2008")
  54.  
  55.                If $var <> "1.0" Then
  56.  
  57.                     $CMD = "C:\Temp\dotNetFramework\dotnetfx35setup.exe /q /norestart"
  58.                        RunWait(@comspec & " /k " & $CMD)
  59.                     Sleep (60000)
  60.  
  61.                     $CMD = "C:\Temp\BITS\x64.msu  /quiet /norestart"
  62.                        RunWait(@comspec & " /c " & $CMD)
  63.                     Sleep (60000)
  64.  
  65.                     $CMD = "C:\Temp\WMF\x64.msu  /quiet /norestart"
  66.                        RunWait(@comspec & " /c " & $CMD)
  67.  
  68. MsgBox(0, "", "Done")
  69.  
  70.                Else
  71.  
  72.                     $CMD = "ServerManagerCmd.exe -remove PowerShell -restart"
  73.                        RunWait(@comspec & " /k " & $CMD)
  74.                    Sleep (60000)
  75.  
  76.                         $CMD = "C:\Temp\dotNetFramework\dotnetfx35setup.exe /q /norestart"
  77.                        RunWait(@comspec & " /k " & $CMD)
  78.                     Sleep (60000)
  79.  
  80.                     $CMD = "C:\Temp\BITS\x64.msu  /quiet /norestart"
  81.                        RunWait(@comspec & " /c " & $CMD)
  82.                     Sleep (60000)
  83.  
  84.                     $CMD = "C:\Temp\WMF\x64.msu  /quiet /norestart"
  85.                        RunWait(@comspec & " /c " & $CMD)
  86.  
  87. MsgBox(0, "", "Done")
  88.  
  89.  
  90.                EndIf
  91.          EndIf
  92.  
  93.  
  94.  
  95.  Case "WIN_2003","WIN2003R2"
  96.  
  97.          If @OSArch = "x86" Then
  98.  
  99.  
  100.  
  101.                If $var <> "1.0" Then
  102.  
  103.                     $CMD = "C:\Temp\dotNetFramework\dotnetfx35setup.exe /q /norestart"
  104.                        RunWait(@comspec & " /k " & $CMD)
  105.                     Sleep (120000)
  106.  
  107.                     $CMD = "C:\Temp\WMF\x86.exe  /quiet /norestart"
  108.                        RunWait(@comspec & " /c " & $CMD)
  109.  
  110.  
  111.  
  112.  
  113.  
  114.                Else
  115.  
  116.  
  117.                     Sleep (360000)
  118.  
  119.                     $CMD = "C:\Temp\dotNetFramework\dotnetfx35setup.exe /q /norestart"
  120.                        RunWait(@comspec & " /k " & $CMD)
  121.                     Sleep (360000)
  122.  
  123.                     $CMD = "C:\Temp\WMF\x86.exe  /quiet /norestart"
  124.                        RunWait(@comspec & " /c " & $CMD)
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                EndIf
  131.  
  132.          ElseIf @OSArch = "x64" Then
  133.  
  134.  
  135.  
  136.  
  137.                If $var <> "1.0" Then
  138.  
  139.                      $CMD = "C:\Temp\dotNetFramework\dotnetfx35setup.exe /q /norestart"
  140.                        RunWait(@comspec & " /k " & $CMD)
  141.                     Sleep (120000)
  142.  
  143.                     $CMD = "C:\Temp\WMF\x64.exe  /quiet /norestart"
  144.                        RunWait(@comspec & " /c " & $CMD)
  145.  
  146.                Else
  147.  
  148.  
  149.                   Sleep (360000)
  150.  
  151.                      $CMD = "C:\Temp\dotNetFramework\dotnetfx35setup.exe /q /norestart"
  152.                        RunWait(@comspec & " /k " & $CMD)
  153.  
  154.                   Sleep (120000)
  155.  
  156.                      $CMD = "C:\Temp\WMF\x86.exe  /quiet /norestart"
  157.                        RunWait(@comspec & " /c " & $CMD)
  158.  
  159.  
  160.                EndIf
  161.  
  162.  
  163.          EndIf
  164.  
  165.  
  166.  
  167.  
  168.    MsgBox(0, "", "Not a Supported OS Version")
  169.  

Function exit from script with StdOut error

$
0
0

I wanted to make a script of mine, to "remember" the path, selected by a user and start the application without the user need to show it the path everytime, but the function causes the script to exit and give an error.

 

I was able to achive this by makin an ini file in the directory.

 

my function goes like this:

AutoIt         
Func UD_uszi_belepes()    If WinExists("UDUsziMainForm") Then ;Check if the program is already running         MsgBox(0, "Üzenet", "Az UD_üszi már fut!")         $UD_uszi_belepesRun = False         Return    EndIf    If FileExists(@ScriptDir &"\PathToUszi.ini") = 1 Then ;Check if ini exists       $iniRead = IniRead(@ScriptDir &"\PathToUszi.ini", "Folder", "Location", "")       Run($iniRead & "\UD_uszi.exe")       Sleep(2000)       ControlSetText("TLoginForm", "UD ÜSZI", "TEdit2", "BALAZSGE")       Send("{TAB}BALAZSGE")       Sleep(50)       Send("{ENTER}")       $UD_uszi_belepesRun = False       Return    EndIf     Local $StartFileSelectFolder = FileSelectFolder("Adja meg az UD_uszi.exe helyét!", "")     If @error = 1 Then         MsgBox(0, "Üzenet", "Nem választott ki mappát")         $UD_uszi_belepesRun = False         Return     EndIf     Run($StartFileSelectFolder & "\UD_uszi.exe")     Local $UD_usziBelepes = WinWaitActive("UD ÜSZI", "", 15)     If $UD_usziBelepes = 0 Then         MsgBox(0, "Üzenet", "A kérés feldolgozási ideje magas!" & @CRLF & "Kérem próbálja újra, vagy nyissa meg manuálisan.")         $UD_uszi_belepesRun = False         Return      Else         Local $WhereisFolder = IniWrite (@ScriptDir &"\PathToUszi.ini", "Folder", "Location", $sFileSelectFolder)         ControlSetText("TLoginForm", "UD ÜSZI", "TEdit2", "BALAZSGE")         Send("{TAB}BALAZSGE")         Sleep(50)         Send("{ENTER}")     EndIf     $UD_uszi_belepesRun = False EndFunc   ;==>UD_uszi_belepes

I have some problems with my debugging and I can't figure out why my script do what it does

does SciTE Script Editor have an auto re-run functionality?

$
0
0

Often when i try to run a script hitting F5 it doesn't do anything because its still running in the background from the last time I tested it >_< does anyone know if there is a way to auto kill / restart it - I assume not because that could possibly interfere with script functionality so i guess getting used to hitting ctrl + break (to stop a possibly running script) would be the way to go... or even lazier is there a way to rebind scite keyboard shortcuts? would be nice to bind it to f4 then you could just hit both in tandem every time 

Making a toggle button while searching array is interrupting

$
0
0

Hello,

 

I'm trying to make a script that checks for a UI element to tell if the correct mode is toggled turned on. The native program's UI displays the status of this mode via a thumbnail. I'm trying to get the script to toggle the mode between true or false, but sometimes it gets messed up when I'm pressing the keys very quickly or switching between functions (calling a function more than once, Send command doesn't send, etc). So I tried to add a self correct function that would scan the thumbnails at the top of the program menu. This would update and self-correct those errors every two seconds or so (in reality I want to do it faster, but two seconds seemed like a safe "test run"). 

It's simply not working the way I intended, and I've tried so many different approaches.

Here is the latest approach:

AutoIt         
Global $hkt = TimerInit() Global $hktd Global $overide Global $cmarr[10] Global $cmpressable Global $cmmode HotKeySet ("{1}", "HotKey1") HotKeySet ("{2}", "HotKey2") HotKeySet ("{3}", "HotKey3") HotKeySet ("{4}", "HotKey4") HotKeySet ("{5}", "HotKey5") HotKeySet ("{6}", "HotKey6") HotKeySet ("{7}", "HotKey7") HotKeySet ("{8}", "HotKey8") HotKeySet ("{9}", "HotKey9") HotKeySet ("{0}", "HotKey0") HotKeySet ("{-}", "HotKey11") HotKeySet ("{=}", "HotKey12") While 1 = 1     $hktd = TimerDiff($hkt) ;; Yes, I know this is processor intensive. In reality there are some other instructions in the While loop, but for now I'll add a Sleep ( 50 ) at the bottom of loop.     If $hktd >= 2000 Then ;; I added these time delays to prevent it from trying to correct the toggle status too often (the program UI takes some time to display which mode it is in).         $override = False         For $cm = 0 to UBound($cmarr) - 1             $hktd = TimerDiff($hkt)             $cmpressable = PixelGetColor(1290, 876)             $xposition = 600 + ($cm * 25)             $cmarr[$cm] = PixelGetColor($xposition, 55)             If $hktd >= 2000 and $cmarr[$cm] = 15636838 and $override = False Then ;; I added these time delays to prevent it from trying to correct the toggle status too often (the program UI takes some time to display which mode it is in).                 $cmmode = True ;; This seems to cause some trouble when the For...Next loop is sometimes interrupted via HotKeyX()                 ExitLoop             ElseIf $hktd >= 2000 and $override = false and $cm = UBound($cmarr) - 1 Then                  $cmmode = False ;; This seems to cause some trouble when the For...Next loop is sometimes interrupted via HotKeyX()             EndIf         Next                 ;; I also tried doing an _ArraySearch function here after the loop completes, but it's still the same problem. The UI element appeared at $cm[3] while the For... Next loop was searching on $cm[4]+, the For...Next therefore thinks "NOT FOUND, LETS DECLARE IT FALSE", but in reality it showed up with bad timing.     EndIf         Sleep ( 50 ) ;; Not actually in my script. Just added for this forum post. WEnd Func HotKey1()     HotKeySet ("{1}")     $hktd = TimerDiff($hkt)     If $cmmode = True Then         $cmpressable = PixelGetColor(1290, 876)         If $cmpressable = 9013641 Then         $override = True         $cmmode = False         Send ("9")         $hkt = TimerInit()         EndIf     EndIf     Sleep (250) ;; Just put these sleeps in a few of the calls to see if it improved the functions, it didn't seem to make a difference.     Send ("{1}")     HotKeySet ("{1}", "HotKey1") EndFunc Func HotKey2()     HotKeySet ("{2}")     $hktd = TimerDiff($hkt)     If $cmmode = True Then         $cmpressable = PixelGetColor(1290, 876)         If $cmpressable = 9013641 Then         $hkt = TimerInit()         Send ("9")         $override = True         $cmmode = False         EndIf     EndIf     Sleep (250)     Send ("2")     HotKeySet ("{2}", "HotKey2") EndFunc Func HotKey3()     HotKeySet ("{3}")     $hktd = TimerDiff($hkt)     If $cmmode = True Then         $cmpressable = PixelGetColor(1290, 876)         If $cmpressable = 9013641 Then             $hkt = TimerInit()             $override = True             $cmmode = False             Send ("9")         EndIf     EndIf     Sleep (250)     Send ("3")     HotKeySet ("{3}", "HotKey3") EndFunc Func HotKey4()     HotKeySet ("{4}")     If $cmmode = False Then         $override = True         $cmmode = True         Send ("9")         $hkt = TimerInit()     Else         Send ("4")     EndIf     Sleep (250)     Send ("4")     HotKeySet ("{4}", "HotKey4") EndFunc Func HotKey5()     HotKeySet ("{5}")     If $cmmode = True Then         $override = True         $cmmode = False         Send ("9")         $hkt = TimerInit()     Else         Send ("5")     EndIf     Sleep (250)     Send ("5")     HotKeySet ("{5}", "HotKey5") EndFunc Func HotKey6()     HotKeySet ("{6}")     If $cmmode = False Then         $override = True         $cmmode = True         Send ("9")         $hkt = TimerInit()     Else         Send ("6")         MouseMove (840, 435, 0)     EndIf     Sleep (250)     HotKeySet ("{6}", "HotKey6") EndFunc Func HotKey7()     HotKeySet ("{7}")     $hktd = TimerDiff($hkt)     If $cmmode = False Then         $override = True         $cmmode = True         Send ("9")         $hkt = TimerInit()     Else         Send ("7")     EndIf     Sleep (250)     HotKeySet ("{7}", "HotKey7") EndFunc Func HotKey8()     HotKeySet ("{8}")     $hktd = TimerDiff($hkt)     If $cmmode = False Then         $override = True         $cmmode = True         Send ("9")         $hkt = TimerInit()     Else         Send ("8")     EndIf     Sleep (250)     HotKeySet ("{8}", "HotKey8") EndFunc Func HotKey9()     HotKeySet ("{9}")     Send ("{9}")     HotKeySet ("{9}", "HotKey9") EndFunc Func HotKey0()     HotKeySet ("{0}")     Send ("{0}")     HotKeySet ("{0}", "HotKey0") EndFunc Func HotKey11()     HotKeySet ("{-}")     Send ("{-}")     HotKeySet ("{-}", "HotKey11") EndFunc Func HotKey12()     HotKeySet ("{=}")     Send ("{=}")     HotKeySet ("{=}", "HotKey12") EndFunc

UIA_TextControlTypeID condition

$
0
0

Hello,

 

I am encountering a specific situation using UIAWrappers.au3. I am able to focus on my element. I want my script to execute certain actions depending on certain conditions .... 

 

The only variable that will be changing in this situation is the title ... control type will always be the same ... 

 

I want msg boxes to be displayed depending on the different titles of the controltypeid's. Here is my code so far ... Any ideas on how to code this would be greatly appreciated :-)

 

 

#include "UIAWrappers1.au3"
#include <MsgBoxConstants.au3>
AutoItSetOption("MustDeclareVars", 1)
 
#AutoIt3Wrapper_UseX64=N  ;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os
 
; Run
ShellExecute("mobsync.exe")
 
; Wait 2 seconds for windows explorer to appear.
WinWait("Sync Center")
 
IF Not WinActive("{CLASS:CabinetWClass}", "Sync Center") Then WinActivate("{CLASS:CabinetWClass}", "Sync Center")
 
Local $oP7=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Sync Center;controltype:=UIA_WindowControlTypeId;class:=CabinetWClass", $treescope_children)
_UIA_Action($oP7,"setfocus")
Local $oP6=_UIA_getObjectByFindAll($oP7, "Title:=Sync Center;controltype:=UIA_PaneControlTypeId;class:=ShellTabWindowClass", $treescope_children)
_UIA_Action($oP6,"setfocus")
Local $oP5=_UIA_getObjectByFindAll($oP6, "Title:=;controltype:=UIA_PaneControlTypeId;class:=DUIViewWndClassName", $treescope_children)
_UIA_Action($oP5,"setfocus")
Local $oP4=_UIA_getObjectByFindAll($oP5, "Title:=Shell Folder View;controltype:=UIA_PaneControlTypeId;class:=DUIListView", $treescope_children)
_UIA_Action($oP4,"setfocus")
Local $oP3=_UIA_getObjectByFindAll($oP4, "Title:=Folder View;controltype:=UIA_ListControlTypeId;class:=SysListView32", $treescope_children)
_UIA_Action($oP3,"setfocus")
Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=Folders (1);controltype:=UIA_GroupControlTypeId;class:=", $treescope_children)
_UIA_Action($oP2,"setfocus")
Local $oP1=_UIA_getObjectByFindAll($oP2, "title:=Offline Files;ControlType:=UIA_ListItemControlTypeId", $treescope_subtree)
_UIA_action($oP1,"setfocus")
 
Local $oUIElement=_UIA_getObjectByFindAll($oP1, "title:=Disconnected;ControlType:=UIA_TextControlTypeId", $treescope_subtree)
Local $oUIElement2=_UIA_getObjectByFindAll($oP1, "title:=Sync in progress;ControlType:=UIA_TextControlTypeId", $treescope_subtree)
 
If Local $oUIElement=_UIA_getObjectByFindAll($oP1, "title:=Disconnected;ControlType:=UIA_TextControlTypeId", $treescope_subtree) Then
   _UIA_action($oUIElement,"setfocus")
   MsgBox(0, "Warning!", "Disconnected from the network!", 10)
 
ElseIf Local $oUIElement2=_UIA_getObjectByFindAll($oP1, "title:=Sync in progress;ControlType:=UIA_TextControlTypeId", $treescope_subtree) Then
   _UIA_action($oUIElement,"setfocus")
   MsgBox(0, "Warning!", "Sync is already in progress!", 10)
 
Elseif $MsgBox = MsgBox(0, "Warning!", "Sync is already in progress!", 10)
 
EndIF

AutoIt Consulting?

$
0
0

I was referred to AutoIt as a possible solution to a problem I am working on.  Unfortunately I don't have the time to learn AutoIt in order to get this task done and I am willing to hire someone who can building the following for me.  I would be grateful for any references/advice.

 

Here is what I am looking for:

 

Overview: In Outlook 365 web mail I want to reply to customer emails by simply clicking a button.  We currently have have 7 generic responses we use based on the customer query.

 

Operation: 

 

1.   Webmail client is open

2.   AutoIt dialog box with 7 buttons is open.  The buttons have the short description of the reply as the title.

3.   User selects and reads email to determine appropriate response in webmail

4.   User clicks 1 of 7 buttons in dialog box

5.   AutoIt sets focus on webmail screen.

6.   AutoIt sends the 'r' key (the shortcut key to reply to an email)

7.   AutoIt sends the appropriate text

8.   AutoIt sends the 'alt-s' key (the shortcut key to send)

 

Thoughts?


KeyPress?

FTP Download full folder

$
0
0

Hay there i try to download a folder from a ftp server

$hDownload = InetGet("http://sampleURL/myfolder/",  @ScriptDir& "\myfolder", 1, 1)  Do         Sleep(250) Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)

http://prntscr.com/6ruz70

 

this is what happens.. is it possible to download the folder with all contents inside?

 

 

Elevated program automation via PSExec?

$
0
0
I am trying to make a rather simple script that does exactly what AutoIT was originally meant to do: Automate an IT program via Send(), ControlGetText(), and so forth.
 
It works perfectly fine if I start a Windows 7 remote desktop session to the remote computer, and then from within the remote desktop session:
 - Open an elevated (UAC) command prompt
 - Run the program
 
hPcLjzZ.png
 
 
However, for the life o' me, I simply can not get it to work when launched on a remote computer. Apparently the program I am trying to automate is being launched on the remote machine in a manner that AutoIT cannot interact with the program window.
 
It is exasperating that it works great if I run it from an elevated command prompt via remote desktop. I suppose I could open 400 remote desktop sessions and run it that way on each remote machine, but good lord that's not the way automation is supposed to work.
 
If I try to launch the program remotely, and I also have a remote desktop session open to the remote computer, I can see the program I'm trying to automate that it launches in the "All Users" Task Manager, and I have to kill the process via Task Manager when the automation fails.
 
I have no idea if there's anything that can be "improved" in my source code to fix this, or if the problem is with the command line parameters I'm using with PSExec, or maybe something weird about remote UAC sessions that I don't know about.
AutoIt         
#AutoIt3Wrapper_Change2CUI=y #pragma compile(Console, true) #RequireAdmin #include <File.au3> ; ; CleanWipe automation script by Dale Mahalko ; Email: dmahalko@gmail.com  - Apr 9, 2015 ; Free to redistribute ; ; Compile this into an EXE, using AutoIT: ;     https://www.autoitscript.com/site/autoit/ ; ; Run: ScriptName.exe \\pathto\share\for\cleanwipe ;           C:\Path\To\Temp\Dir  domain\user ;           password ; ; Command parameters are optional. ; You must run this script elevated, as Admin. ; ;======================================================= ; Check for valid source path and files Global $MappedDrive = False, $MDrive, $logfile IF $CmdLine[0] > 0 Then     $WkDir = $CmdLine[1] Else     LogIt("Using working dir as source path. Otherwise" _         & " provide source path as 1st")     LogIt("parameter. (use quotes around path, if there" _         & " are spaces)")     $WkDir = @WorkingDir EndIf IF $CmdLine[0] > 1 Then     $tmpdir = _TempFile($CmdLine[2]) Else     LogIt("Using C:\Windows\Temp as temp path. Otherwise" _         & " provide temp path as 2nd")     LogIt("parameter. (use quotes around path, if there" _         & " are spaces)")     $tmpdir = _TempFile("C:\windows\temp") EndIf LogIt("Work dir: " & $WkDir) LogIt("Temp dir: " & $tmpdir) IF $CmdLine[0] > 2 Then     LogIt("Creating temporary drive mapping using " _     & "parameters 3 and 4 for username and password.")     $MDrive = DriveMapAdd ("*", $WkDir, 0, _         $CmdLine[3], $CmdLine[4])     LogIt("Mapped temp drive letter: " & $MDrive)     LogIt("Using: " & $CmdLine[3] & " - " & $CmdLine[4])     IF (StringLeft($MDrive,1) < "A" Or _         StringLeft($MDrive,1) > "Z") Then         LogIt("Error mapping drive letter.")         Die(@error)     EndIf     $MappedDrive = True EndIf IF Not FileExists($WkDir) Then     LogIt("Can't find source directory.")     Die(0) EndIf IF Not FileExists($WkDir & "\cleanwipe.exe") Then     LogIt("cleanwipe.exe not in source dir." )     Die(0) EndIf IF Not FileExists($WkDir & "\cleanwipe.db") Then     LogIt("cleanwipe.db not in source dir.")     Die(0) EndIf ; Copy CleanWipe to temp directory on Windows PC. $logfile = $tmpdir & "\results.log" DirCreate ($tmpdir) ; LogIt ("Copying cleanwipe files.") FileCopy($WkDir & "\cleanwipe.exe", $tmpdir) FileCopy($WkDir & "\cleanwipe.db", $tmpdir) Local $Why, $What ; LogIt("Launching " & $tmpdir & "\Cleanwipe.exe") $Err = Run($tmpdir & "\Cleanwipe.exe") If $Err = 0 THEN Die(@error) ; LogIt("Waiting 60 seconds for launch") Local $hWnd = WinWait("[TITLE:CleanWipe]", "", 60) If $hWnd = 0 Then Die(@error) ;SendKeepActive("[TITLE:CleanWipe]" ; LogIt("1st window: Click Next") $Err = Send("{Space}") If $Err = 0 Then Die(@error) ; LogIt("2nd window: Click EULA / Next") $Err = Send("{Space}{Tab}{Tab}{Space}") If $Err = 0 Then Die(@error) ; LogIt("3rd window: Click Client software" _    & " / Liveupdate / Next ") $Err = Send("{Space}{Tab}{Tab}{Space}{Tab}{Tab}{Space}") If $Err = 0 Then Die(@error) ; LogIt("4th window: Click don't prompt to reboot / Next") $Err = Send("{Space}{Tab}{Tab}{Tab}{Tab}{Space}") If $Err = 0 Then Die(@error) ; ; Check for any CleanWipe error messages. $WTitle = WinGetTitle("[ACTIVE]") LogIt("Found output window named: " & $WTitle) If $WTitle <> "CleanWipe" Then     LogIt("Error message: " & ControlGetText ( _         $WTitle, "", "[Class:Static; Instance:2]" ))     LogIt("Closing error window, exit CleanWipe.")     ;SendKeepActive($WTitle)     $Err = Send("{Space}")     If $Err = 0 Then Die(@error)     sleep(500)     $Err = Send("{tab}{Space}")     If $Err = 0 Then Die(@error)     sleep(500)     $Err = Send("{Space}")     If $Err = 0 Then Die(@error)     ;     LogIt("Temp dir name left behind: " & $tmpdir)     Die(0) EndIf ; ;   Next> button is inactive during the task. ;   Wait for it to become active. LogIt("Waiting 15 minutes for tasks to complete.") $SleepTimer = 0 Do     Sleep (1000)     $SleepTimer = $SleepTimer + 1     IF $SleepTimer > 900 Then         Die("Waited 900 sec, but it didn't finish.")     EndIf Until (ControlCommand("CleanWipe", '', "[ID:12324]", _     'IsEnabled')) ; LogIt("Job results: ") LogIt(ControlGetText ( "CleanWipe", "", _     "[Class:RichEdit20W; Instance:1]" ) ) ;SendKeepActive("[TITLE:CleanWipe]" LogIt("GUI: Click Next" ) $Err = Send("{Tab}{Space}") If $Err = 0 Then Die(@error) sleep(500) ; LogIt("GUI: Click Finish" ) $Err = Send("{Space}") If $Err = 0 Then Die(@error) sleep(500) ; LogIt("Completed successfully." ) LogIt("Temp dir name left behind: " & $tmpdir) If $MappedDrive = True Then     DriveMapDel($MDrive)     LogIt("Removed temp drive letter: " & $MDrive) EndIf Exit ; Func Die($Why)     LogIt("Error, code: " & $Why )     If $MappedDrive = True Then         DriveMapDel($MDrive)         LogIt("Removed temp drive letter: " & $MDrive)     EndIf     Exit EndFunc Func LogIt($Who)     If $logfile <> "" Then _FileWriteLog($logfile, $Who)     ConsoleWrite($Who & @CRLF) EndFunc

 

Typical successful logged output:

 

 

C:\Windows\Temp\ps_tools>cw-auto-rev5.exe "\\XXXXXXXXXX\NetAdminStuff\SEP_Clean-Wipe" "C:\Windows\temp\ps_tools"  YYYYYYYYY  ZZZZZZZZZ
Work dir: \\XXXXXXXXXX\NetAdminStuff\SEP_Clean-Wipe
Temp dir: C:\Windows\temp\ps_tools\~hljlzgj.tmp
Creating temporary drive mapping using parameters 3 and 4 for username and password.
Mapped temp drive letter: Z:
Using: YYYYYYY - ZZZZZZZZZ
Copying cleanwipe files.
Launching C:\Windows\temp\ps_tools\~hljlzgj.tmp\Cleanwipe.exe
Waiting 60 seconds for launch
1st window: Click Next
2nd window: Click EULA / Next
3rd window: Click Client software / Liveupdate / Next
4th window: Click don't prompt to reboot / Next
Found output window named: CleanWipe
Waiting 15 minutes for tasks to complete.
Job results:
22:23:06        INFO    Initializing removal engine...
22:23:06        INFO    Engine version: 12.1.5337.5000
22:23:07        INFO    Engine initalized succesfully.
22:23:07        INFO    [1/22]: Scanning Windows Installer cache
22:23:07        INFO    [2/22]: Collecting product information
22:23:07        INFO    [3/22]: Processing collected information
22:23:07        INFO    [4/22]: Preparing to remove products
22:23:07        INFO    [5/22]: Unregistering products from Windows Installer database
22:23:07        INFO    [6/22]: Stopping LiveUpdate
22:23:07        INFO    [7/22]: Stopping and removing services
22:23:10        INFO    [8/22]: Unregistering EventLog sources
22:23:10        INFO    [9/22]: Disabling startup items
22:23:10        INFO    [10/22]: Verifying whether a reboot is required
22:23:13        INFO    [11/22]: Reboot
22:23:13        INFO    Task skipped because reboot was not required.
22:23:13        INFO    [12/22]: Stopping LiveUpdate
22:23:13        INFO    Task skipped because reboot was not required.
22:23:13        INFO    [13/22]: Removing unused definitions
22:23:13        INFO    [14/22]: Unregistering LiveUpdate content
22:23:13        INFO    [15/22]: Removing symbolic links
22:23:13        INFO    [16/22]: Removing files and directories
22:23:17        INFO    [17/22]: Unregistering applications from InstalledApps database
22:23:17        INFO    [18/22]: Uninstalling unused LiveUpdate
22:23:17        INFO    [19/22]: Searching registry for product related data
22:23:29        INFO    [20/22]: Removing registry keys
22:23:29        INFO    [21/22]: Removing Windows Firewall exceptions
22:23:30        INFO    [22/22]: Unregistering products from Windows Security Center
22:23:32        INFO    Saving state...
22:23:32        INFO    Removal completed successfully.
 
GUI: Click Next
GUI: Click Finish
Completed successfully.
Temp dir name left behind: C:\Windows\temp\ps_tools\~hljlzgj.tmp
Removed temp drive letter: Z:
 

 

 

However, if I try to launch via PSExec from an elevated local command prompt, it ends up doing dumb things like this:

 

psexec -i -h -u YYYYYYYY -p ZZZZZZZZ \\FFFFFF cmd /c c:\windows\temp\ps_tools\cw-auto-rev5.exe "\\XXXXXXXX\NetAdminStuff\SEP_Clean-Wipe" "C:\Windows\Temp" YYYYYYYY ZZZZZZZZ
 
Failed PSExec remote elevated launch:

 

 

2015-04-09 21:44:29 : Copying cleanwipe files.

2015-04-09 21:44:30 : Launching C:\Windows\Temp\~bfwdsai.tmp\Cleanwipe.exe
2015-04-09 21:44:30 : Waiting 60 seconds for launch
2015-04-09 21:44:31 : 1st window: Click Next
2015-04-09 21:44:31 : 2nd window: Click EULA / Next
2015-04-09 21:44:31 : 3rd window: Click Client software / Liveupdate / Next 
2015-04-09 21:44:31 : 4th window: Click don't prompt to reboot / Next
2015-04-09 21:44:31 : Found output window named: 
2015-04-09 21:44:31 : Error message: 
2015-04-09 21:44:31 : Closing error window, exit CleanWipe.
2015-04-09 21:44:32 : Temp dir name left behind: C:\Windows\Temp\~bfwdsai.tmp
2015-04-09 21:44:32 : Error, code: 0
2015-04-09 21:44:32 : Removed temp drive letter: Z:
 

 

I'm specifying the network username and password twice in my PSExec command line. Once to logon remotely via PSExec and once to map a temporary network drive via my script.
 
I'm making this script map its own temporary network drive to the server, because it seems I usually get Access Denied errors trying to access network shares remotely via PSExec, regardless of what PSExec username password or PSExec command line options I use.
 

Help?

how can return exaclty what StringRegExp found?

$
0
0

I want make multi search strings in a single func.. I can make array and loop search it but it's too slow (I have working on large files). I had read StringRegExp's tut but it have many options make me confused

Example:

$find = "11|22|33" $test1 = "aa]22_bb" $test2 = StringRegExp($test,$find) If $test2 Then      MsgBox(0,"found",$test2) EndIf

How can I know $test2 = "22" ?

How to make an IDE for Autoit

$
0
0

Hi all,

I am planning to make simple yet powerful ide for autoit. I have googled a lot for how to combine a programing language's compiler to my IDE program. But i didn't get any positive response. Any suggestions ?

MouseClick skipping "y" coordinate

$
0
0

I have a script that I am trying to have a simple function to mouse click at a coordinate within the input box. My trouble is that I only want 1 input for X and Y rather than two separate. How can I make that work however when I use the function?

 

Example:

;The input box $Input1 = GUICtrlCreateInput("X", #, #, #, #) ;Retrieving the coordinate $Pos1 = MouseGetPos() GUICtrlSetData($Input1, $Pos1[0] & ", " & $Pos1[1]) ;How do I skip the "Y" definition? retrieving the X and Y from one string? MouseClick("Left", $Input1) ;What I am essentially looking for: MouseClick("Left", $Input1[0], $Input1[1])

 

 

input in flex scanner failed

$
0
0

Today I come to this problem:
 

>Running AU3Check (3.3.13.20)  from:C:\Program Files (x86)\AutoIt3\Beta  input:Z:\TOOLs\Macro........MyScript.au3
input in flex scanner failed
!>09:08:56 AU3Check ended. Press F4 to jump to next error.rc:2
+>09:08:56 AutoIt3Wrapper Finished.
>Exit code: 2    Time: 0.9767

using Au3.3.10.2 is the same problem
 
even if I use SHIFT+F7

- *** Compile in Test mode skipping Tidy; Au3Stripper; Resource updating and Versioning to speed up the process. ***

 
the the same problem appear
 
 
btw.
I checked forum and find this:
http://www.autoitscript.com/forum/topic/86100-flex-scan-error/

and answering:

Couple of things to check:
- check validity of au3check.dat
- do you get the same error when running the script with Beta?
- do you get the same error when running another script?

Jos

 

- check validity of au3check.dat

is this still valid ?

 

- do you get the same error when running the script with Beta?

yes

 

- do you get the same error when running another script?

no

 

And another info

I have my script on TrueCrypt Storage which is located on USB Pendrive

 

6 hour ago I compile the same program with out any problem.

after that I go sleep so I closed the notebook cover, so he, too, went to sleep :)

 

Now when I wake up, eat the breakfast, and wake up my notebook this problem just appear.

 

 

Any concept how to fix this error ?

 

mLipok

 

ps.

I wonder if the fact that I had scrambled eggs is important ;)

 

 

EDIT 1:

Au3Check.dat in attached zip

 

 

 

EDIT 2:

I forgot to say,
Throughout the night the script was opened in SCIT 4 AU3
So I decided to quit SciTe4Au3 and open it again in the hope that he should play the recently open files using the file SciTE.session
That has not happened - indicated script opened in August as a blank tab in SciTe4Au3
 
So I checked in SciTe4Au3 titebar which file location it exactly is.
I made copy of this file, and just press CTRL + S in SciTe4Au3
This file was changed to 0 byte length.
So I back this script from my copy and all is ok.

 

 

 

So now the question is: What exactly happened?

 

EDIT 3:

I was too qucik.

This file opens in notepad and SciTe4Au3

but compileation was still a problem

 

some more checking and when I want to View this file in TotalCommander by using TC Internal Viewer , then new message Appear: Error Reading File

 

Now all is clear.

 

EDIT 4:

check disk in progress ...

 

Best regards,

mLipok

Attached Files


Different between 2 macros

$
0
0

Happy Friday everyone!

 

I would like to ask a pretty basic question, precisly whats the different between @ScriptDir and @AppDataDir? I know that @ScriptDir is the path for where the script (compiled/uncompiled version) is. Just today I read around some of the codes posted, and to me they seem to be similar after I read the help file. I didn't want to ask it in PM from the poster of the code where I read it

 

Sorry for the elemetary question, and thank you for the enlightenment!

RecordSet GetRows() column name

$
0
0

I use my script to open connection with my SQL Server. I send query and receive results by method called "GetRows()", example:

$connection = ObjCreate ("ADODB.Connection") $result = ObjCreate("ADODB.RecordSet") $connection.Open("DRIVER={SQL Server};" & $SQL_Login_Details & ";") $result.Open($SQL_Query, $connection) $array = $result.GetRows() _ArrayDisplay($array)

in results, I get this:

ai.png

 

As you can see all colums are named by default (Col 0, Col1 ,Col 2...)

 

when I execute this query in "SQL Server Management Studio" then I got table with named colums like this:

ms.png

 

any chance to get same column names in autoit array?

How can i separate two lines of code?

RegExp - get rid of spaces around string?

$
0
0

Hi guys!

i want to clear up string from possible spaces around string (they can be there, ormay be not). problem is - there can be spaces in middle, and im a newbie in regexp.

 

right now im using a stone hammer to cut off them:

$newipspis = "   DS TSDAPAR1TTHG "             while stringleft($newipspis,1) = " " or stringright($newipspis,1) = " "                if stringleft($newipspis,1) = " " then $newipspis = StringTrimLeft($newipspis,1)                if stringright($newipspis,1) = " " then $newipspis = StringTrimright($newipspis,1)             WEnd

maybe there is a better way to do this??

Cannot hook the windows

$
0
0

Hello i got trouble when i try to move the CMD windows in the picture attached

 

Anyhelp apreciated... not my first winmove...

*

Here the used code

 Case $ControlCPL                      GUISetState(@SW_SHOW, $hGUI2)                      GUISetState(@SW_HIDE, $hGUI)                      RunAs ( $UID&"", @ComputerName&"",$Password&"", "" , "C:\Windows\System32\Cmd.exe" )                      Sleep (2000)                      WinMove("Administrateur : C:\Windows\System32\Cmd.exe","",0,0)                      WinMove("Administrator: C:\Windows\System32\Cmd.exe","",0,0)                      WinMove("Console ADMIN","",660,0)

I got the both language in my PC Park so that's why i use administrator and administrateur line

 

It work with administrator but not administrateur....

 

Sans_titre2.png

Viewing all 12506 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>