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

Searching word docs

$
0
0
Hi Guys

I have hundreds of word templates and need to loop through them checking each one for the existence of checkboxes. I have googled but not found anything useful.

Is this possible? Any tips on how I can achieve it?

Cheers

.htaccess and .htpasswd

$
0
0
Hi. I have made a .htaccess file:

AuthUserFile /home/fileprot/public_html/test/.htpasswd
AuthType Basic
AuthName "My Files"
Require valid-user


and in my .htpasswd the login is stored.

It's a simple authentication.

Does anyone knows how I would make a autoit script that authenticates with that login?

Posted Image

(I need it all to authenticate silent, maybe winhttp can do it?)

need help

$
0
0
i need scripe for crashed exe after Recompile from any recompiler anyone please help me i need to put in my exe i am not a programmer but i recompile an exe file and dont let anyone to interfare in my recompile files ^_^ please help me.................

Modify a sring in a .bat file in multiple shares in a specific subfolder\file

$
0
0
Good Day all,

I created a script which will search for a servername in a drive mapping (NET USE command) in a specific folder and file on every user share and if found it will replace the old servername with the new servername.  It works perfectly if I specify the \\servername\sharename\common folder\common file.  I searched the forum and found a few pointers but I just can't get around it.

Here is the structure I am working with:

The script will read the source file Sharelist.txt until the EOF.  Here is the structure of the file:
\\servername\rootsharename1$
\\servername\rootsharename2$
\\servername\rootsharename3$ and so on.

Under the rootsharename are the usershares with the \common folder\common file.

ex:
\\servername\rootsharename1$\JohnD\NET\mapdrive.bat
\\servername\rootsharename1$\JoeB\NET\mapdrive.bat
\\servername\rootsharename1$\SamP\NET\mapdrive.bat
\\servername\rootsharename2$\BobT\NET\mapdrive.bat
\\servername\rootsharename2$\RickP\NET\mapdrive.bat and so on

I need help on how to get the script to go from one usershare to the other.

Thanks

Encoding problem

$
0
0
I send text data to a server and when it contains non-English(russian for example)letters, then received string is displayed incorrect. How to fix this? I think encoding on my Android client is utf-8. Please help.

Run Not Closing Stream

$
0
0
As part of an application I am writing, I need to find all files matching a criteria on a computer. Based on examples I found, once the Run command is complete, the loop should exit, however I found that the loop would run indefinitely.
I ended up adding some timer logic, to automatically exit the loop if 5 seconds passed.

Does anyone know why my loop will not exit automatically when the Run function finishes?

[ autoit ]      
$StartTime = TimerInit() $Config_File_Path = Run(@ComSpec & " /c dir /s /b application.config", "C:\", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While 1 $line = StdoutRead($Config_File_Path) ConsoleWrite($line) If @error <> 0 Then ExitLoop If TimerDiff($StartTime) > 5000 Then ExitLoop Wend

Disable/Enable Local Area Connection

$
0
0
I would like to Disable/Enable a Local Area Connection.

I found this script that isn't working in Win_7  SP1 64bit.

I'm getting an error on line 108 saying Variable used without being declared.

Is there an #include that I am supposed to have?  This was originally created in 2008.  Maybe AutoIt changed?

[ autoit ]         
AutoItSetOption("TrayIconDebug", 1) ;0-off Local $Res ; Activation of all network cards. ; _NetCC (" All ") ; Activation of all network cards the name of which contains "place ". ; _NetCC ("place ", 1, 0) ; Deactivation of connection 1394. _NetCC (" local ", 0) ; Deactivation of a nonexistent connection and return of error. ; $Res _NetCC ("Connection XYZ", 0) MsgBox (0, "Information ", "$Res " & $Res & " @Error " & @error & " @Extented " & @extended) #cs =================================================================================================================== Network Connection Control (NetCC.au3) By Tlem Aviable Functions : _NetCC() = Change state or get state of network connections _NetCCGetList() = Get list of network connections. Some parts of this code is inspired from other codes. So tanks to : SvenP, Danny35d, smashly. - http://www.autoitscript.com/forum/index.php?showtopic=12645&view=findpost&p=87000 - http://www.autoitscript.com/forum/index.php?showtopic=72165&view=findpost&p=528862 - http://www.autoitscript.com/forum/index.php?showtopic=74074&view=findpost&p=538835 #ce =================================================================================================================== #include-once #RequireAdmin Global Const $NETWORK_FOLDER = 0x31 Global $strEnableVerb, $strDisableVerb, $strRepairVerb, $strStateVerb, $strFolderName ;==================================================================================================================== ; Name           : _NetCC ; Description    : Activate or deactivate a Network Interface Controler (NIC) ; Syntax         : _NetCC($oLanConnection, [$iFlag, , [$iFullName]]) ; Parameter(s)   : $oLanConnection - The name of the Lan connection. ; If equal to 'All' then change state of all NIC. ;                    $iFlag - 0 = Disable connection. ; 1 = Enable connection (default) ; 2 = Toggle connection ; 3 = Repair connection ; 4 = Check State of a connection. ;                    $iFullName - Look for string $oLanConnection in NIC name (Default 1 for full name). ; Requirement(s) : Win32_NT OS ; Return value(s) : On Success - Return 1 ;                    On Failure - Return 0 and @error 1~5. ; @error 1 = Not Win32_NT OS ; @error 2 = Network folder not find. ; @error 3 = Lan connection not find. ; @error 4 = Shell Application object creation error. ; @error 5 = Verb or function not available. ; Author         : Tlem <tlem at tuxolem dot net> ; http://www.autoitscript.fr/forum/viewtopic.php?f=21&t=1092 ; Note(s)        : ; ; To Do : Get individual errors for changing state of multiple NIC (Perhaps with array). ; =================================================================================================================== Func _NetCC($oLanConnection, $iFlag = 1, $iFullName = 1) ; Control OS type. If @OSTYPE <> "WIN32_NT" Then Return SetError(1, 0, 0) EndIf ; W2K/XP/W2K3 If StringInStr("WIN_2000,WIN_XP,WIN_2003,WIN_7", @OSVersion) Then ; Change all NIC state. If StringLower($oLanConnection) = "all" Then $Res = _NetCCAll($iFlag, 0) ; Change NIC state by partial name. ElseIf $iFullName = 0 Then $Res = _NetCCPartial($oLanConnection, $iFlag, 0) ; Change NIC state for $oLanConnection. Else $Res = _NetCCWin32($oLanConnection, $iFlag, $iFullName) EndIf Else ; Vista/W2K8 ; Option repair not exits in Vista/2008 If $iFlag = 3 Then Return SetError(5, 0, 0) ; Change all NIC state. If StringLower($oLanConnection) = "all" Then $Res = _NetCCAll($iFlag, 1) ; Change NIC state by partial name. ElseIf $iFullName = 0 Then $Res = _NetCCPartial($oLanConnection, $iFlag, 1) ; Change NIC state for $oLanConnection. Else $Res = _NetCCWin32New($oLanConnection, $iFlag, $iFullName) EndIf EndIf Return SetError(@error, @extended, $Res) EndFunc ;==>_NetCC ; Only for W2K/XP/W2K3 Func _NetCCWin32($oLanConnection, $iFlag = 1, $iFullName = 1) Local $objShell, $objFolder $objShell = ObjCreate("Shell.Application") If Not IsObj($objShell) Then Return SetError(2, 0, 0) $objFolder = $objShell.NameSpace($NETWORK_FOLDER) If Not IsObj($objFolder) Then Return SetError(3, 0, 0) ; Find the collection of the network connection name. For $LanItem In $objFolder.Items If StringLower($LanItem.Name) = StringLower($oLanConnection) Then $oLanConnection = $LanItem ExitLoop EndIf Next ; If no network connection name then return error. If Not IsObj($oLanConnection) Then Return SetError(3, 0, 0) $oEnableVerb = "" $oDisableVerb = "" ; Find the state of the network connection. For $Verb In $oLanConnection.Verbs If $Verb.Name = $strEnableVerb Then $oEnableVerb = $Verb If Not IsObj($oEnableVerb) Then Return SetError(5, 0, 0) $State = 0 EndIf If $Verb.Name = $strDisableVerb Then $oDisableVerb = $Verb If Not IsObj($oDisableVerb) Then Return SetError(5, 0, 0) $State = 1 EndIf If $Verb.Name = $strRepairVerb Then $oRepairVerb = $Verb If Not IsObj($oRepairVerb) Then Return SetError(5, 0, 0) EndIf Next ; Return State If $iFlag = 4 Then Return $State ; Repair Net Connection ElseIf $iFlag = 3 And $State = 1 Then $oRepairVerb.DoIt ; Toggle Net Connection ElseIf $iFlag = 2 Then If $State = 1 Then $oDisableVerb.DoIt Else $oEnableVerb.DoIt EndIf ; Enable Net Connection ElseIf $iFlag = 1 And $State = 0 Then $oEnableVerb.DoIt ; Disable Net Connection ElseIf $iFlag = 0 And $State = 1 Then $oDisableVerb.DoIt ; Else there is an error Else Return SetError(5, 0, 0) EndIf ; Loop to wait change state (for changing state of more than one connection). $begin = TimerInit() While 1 $dif = Int(TimerDiff($begin) / 1000) If $dif > 10 Then ExitLoop ; Control the state of the NIC to exit before the end of waiting time. If $iFlag = 3 And _NetCCWin32($oLanConnection, 4) = 1 Then ExitLoop If $iFlag = 2 And $State = 1 And _NetCCWin32($oLanConnection, 4) = 0 Then ExitLoop If $iFlag = 2 And $State = 0 And _NetCCWin32($oLanConnection, 4) = 1 Then ExitLoop If $iFlag = 1 And _NetCCWin32($oLanConnection, 4) = 1 Then ExitLoop If $iFlag = 0 And _NetCCWin32($oLanConnection, 4) = 0 Then ExitLoop Sleep(100) WEnd ; Set the return value of the function. $Res = _NetCCWin32($oLanConnection, 4) If $iFlag = 4 And $Res = 1 Then Sleep(3000) Return 1 ElseIf $iFlag = 1 And $Res = 0 Then Return 0 ElseIf $iFlag = 0 And $Res = 1 Then Return 0 Else Return 1 EndIf EndFunc ;==>_NetCCWin32 ; Only for Vista/W2K8 Func _NetCCWin32New($oLanConnection, $iFlag = 1, $iFullName = 1) Local $objWMIService, $colItems, $iModState = 0 $objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", 0x30) If Not IsObj($colItems) Then Return SetError(4, 0, 0) ; Change NIC state of $oLanConnection ; Check name of the connection For $objItem In $colItems If $objItem.NetConnectionID = $oLanConnection Then ; Check State. If $iFlag = 4 Then If $objItem.NetEnabled = True Then Return 1 Else Return 0 EndIf Else ; Change the State of Net Connection. ; Disable Net Connection If $iFlag = 0 And $objItem.NetEnabled = True Then $objItem.Disable ; Enable Net Connection ElseIf $iFlag = 1 And $objItem.NetEnabled = False Then $objItem.Enable ; Toggle Net Connection ElseIf $iFlag = 2 Then If $objItem.NetEnabled = True Then $objItem.Disable $State = 1 Else $objItem.Enable $State = 0 EndIf EndIf ; One change be done. $iModState = 1 EndIf ExitLoop EndIf Next ; If no connection then error. If $iModState = 0 Then Return SetError(3, 0, 0) ; Loop to wait state change. If $iFlag = 4 Then While $iFlag <> _NetCCWin32New($oLanConnection, 4) Sleep(250) WEnd Else Sleep(1000) If $iFlag = 2 Then If $State = 0 And _NetCCWin32New($oLanConnection, 4) = 1 Then Return 1 ElseIf $State = 1 And _NetCCWin32New($oLanConnection, 4) = 0 Then Return 1 Else Return 0 EndIf ElseIf $iFlag = 1 And _NetCCWin32New($oLanConnection, 4) = 1 Then Return 1 ElseIf $iFlag = 0 And _NetCCWin32New($oLanConnection, 4) = 0 Then Return 1 Else Return 0 EndIf EndIf EndFunc ;==>_NetCCWin32New ;==================================================================================================================== ; Name           : _NetCCGetList() ; Description    : Get list of network connections. ; Syntax         : _NetCCGetList() ; Parameter(s)   : NA. ; Requirement(s) : Win32_NT OS ; Return value(s) : Array of network connections. ;                    On Failure - Return 0 and @error 3. ; @error 3 = Lan connection not find. ; Author         : Tlem <tlem at tuxolem dot net> ; http://www.autoitscript.fr/forum/viewtopic.php?f=21&t=1092 ; Note(s)        : ; ; =================================================================================================================== Func _NetCCGetList() ; W2K/XP/W2K3 If StringInStr("WIN_2000,WIN_XP,WIN_2003", @OSVersion) Then Local $objShell, $objFolder, $sTmp = '' _NetCCLang() $objShell = ObjCreate("Shell.Application") If Not IsObj($objShell) Then Return SetError(4, 0, 0) $objFolder = $objShell.NameSpace($NETWORK_FOLDER) If Not IsObj($objFolder) Then Return SetError(3, 0, 0) For $objItem In $objFolder.Items For $oVerb In $objItem.Verbs If StringInStr($oVerb.Name, $strStateVerb) Then $sTmp &= $objItem.Name & "|" Next Next Else ; Vista/W2K8 Local $objWMIService, $colItems, $sTmp = '' $objWMIService = ObjGet("winmgmts:\\localhost\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", 0x30) If Not IsObj($colItems) Then Return SetError(4, 0, 0) For $objItem In $colItems If $objItem.NetConnectionID Then $sTmp &= $objItem.NetConnectionID & "|" EndIf Next EndIf If $sTmp = '' Then Return SetError(3, 0, 0) $aNetList = StringSplit(StringTrimRight($sTmp, 1), "|") Return $aNetList EndFunc ;==>_NetCCGetList Func _NetCCAll($iFlag, $Func = 0) $iModState = 0 $aNetCon = _NetCCGetList() For $i = 1 To $aNetCon[0] If $Func = 1 Then _NetCCWin32New($aNetCon[$i], $iFlag) Else _NetCCWin32($aNetCon[$i], $iFlag) EndIf $iModState = 1 Next ; If no connection find. If $iModState = 0 Then Return SetError(3, 0, 0) Else Return 1 EndIf EndFunc ;==>_NetCCAll Func _NetCCPartial($oLanConnection, $iFlag, $Func) $iModState = 0 $aNetCon = _NetCCGetList() For $i = 1 To $aNetCon[0] If StringInStr(StringLower($aNetCon[$i]), StringLower($oLanConnection)) Then If $Func = 1 Then _NetCCWin32New($aNetCon[$i], $iFlag) Else _NetCCWin32($aNetCon[$i], $iFlag) EndIf $iModState = 1 EndIf Next ; If no connection find. If $iModState = 0 Then Return SetError(3, 0, 0) Else Return 1 EndIf EndFunc ;==>_NetCCPartial Func _NetCCLang() ; Langage selection. Select ; English (United States) Case StringInStr("0409,0809,0c09,1009,1409,1809,1c09,2009,2409,2809,2c09,3009,3409", @OSLang) $strEnableVerb = "En&able" $strDisableVerb = "Disa&ble" $strRepairVerb = "Re&pair" If @OSVersion = "WIN_2000" Then $strStateVerb = "St&ate" ; Windows 2000 (Not sur if correct) Else $strStateVerb = "Stat&us"; Windows XP EndIf ; Français (France) Case StringInStr("040c,080c,0c0c,100c,140c,180c", @OSLang) $strEnableVerb = "&Activer" $strDisableVerb = "&Désactiver" $strRepairVerb = "&Réparer" If @OSVersion = "WIN_2000" Then $strStateVerb = "É&tat" ; Windows 2000 Else $strStateVerb = "Sta&tut"; Windows XP EndIf ; Add here the correct Verbs for your Operating System Language EndSelect EndFunc ;==>_NetCCLang

Thanks for looking at it,

Docfxit

Find value > 3600 on a txt and print the line

$
0
0
Hi all!

I have a file.txt with all info about process running and I want to print out only lines / rows that have a value bigger then 3600 under "Time"
So for example if I have the attacched file, I have to print the line or lines:


29 DIA 11440 Run yes no 1 5699 SAPDBKDF 150 U818BARONC


is this easy to do? I think I should use  _FileReadToArray and then loop something but don't know what.
tnx for reply :bye:

Attached Files


StringReg extract last numbers

$
0
0
I have files that are named as follwing "FILENAME_MORETEXT_11111.rar"
and i would like to get the number "11111" this value could be from 1 to 10 numbers

thanks in advance

Deleting rows out of excel through _ExcelReadSheetToArray

$
0
0
Admittedly, I have not done much with the Excel UDF, though what little I have used it has always worked flawlessly. The issue I am encountering below I am pretty sure is more due to the way I am handling the array rather than Excel, but would appreciate any suggestions.

I am reading the necessary rows and colums from a spreadsheet (attached) into an array. I am then cycling through the array to delete rows if they meet certain criteria. I am currently using Ubound, but don't believe I am doing so correctly as the script fails to grab all the rows that match the criteria. I have always stayed away from ReDim, but is this a case where I would have to use it?

[ autoit ]      
#include <Array.au3> #include <Excel.au3> $oExcel = _ExcelBookOpen(@DesktopDir & "\ACC.xls", 1) Local $aArray = _ExcelReadSheetToArray($oExcel, 1, 1, 0, 3) For $i = 1 To UBound($aArray) -1 Select Case StringInStr($aArray[$i][2], "Citrix")     _ExcelRowDelete($oExcel, $i) Case StringInStr($aArray[$i][2], "Microsoft")     _ExcelRowDelete($oExcel, $i) EndSelect Next

Attached Files

  • Attached File  ACC.xls   31K   7 downloads

How to save the notepad file on desktop and also send that file to my email address

$
0
0
WinWaitActive("Notepad", "")
Send("!s")
WinWaitActive("Save As", "")
Sleep (1000)
; Send the name we found was next in line
Send(@DesktopCommonDir & "abcd" & ".text")
Sleep(1000)
Send("!s")

benchmark similar alternative AutoIT commands with an AutoIT script

$
0
0
I made an universal AutoIT function to calculate the time taken by similar alternative AutoIT commands, in order to compare the different times and chose the fastest or more efficient one:

[ autoit ]      
Func chrono($command)      ProcessSetPriority("AutoIt3.exe", 5)       ; to set the engine to realtime priority      local $timer = TimerInit()            ; initialize timer      local $timer_null_command = TimerDiff($timer)     ; measure the net time without the command (if any)      execute($command)    ;  run the command to be time-measured      local $timer_post = TimerDiff($timer)     ;  stops the chronometer      return = return Int($timer_post-$timer_null_command)     ; return the net time taken by the command EndFunc


Do you think that the      ProcessSetPriority("AutoIt3.exe", 5)    and the   $timer_post-$timer_null_command    are a good method to obtain more precision?

Note: I then enhanced the script by calculating with a cycle the average time of the last 5 repetitions of the command with a stable (+-15%) time result between the lowest and highest value of the serie (the 5 last values).

Strings in binary file

$
0
0
Hi
I have a binary file, which contains strings separated by 0x00 character. I want to export them, but the only i can make is this:
[ autoit ]      
$C = "" $Str = "" $P = 1 Do $Str &= BinaryToString($C) $C = Binarymid ($Binaryfile, $P, 1) $P += 1 Until $C = 0

But it is too slow. Is there any better way, to read the whole string til the 00 char?

Any good way to speed up this script?

$
0
0
Basically i made a script for scraping the api that http://www.guildwarstrade.com/ has made public, but it does so at such a low rate for the moment. Do anyone see a way to speed up this script?
[ autoit ]         
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;GWT data retreiver --> % profit #include #include #include ;Temp[1] = Sell ;Temp[2] = Update ;$temp[3] = Buy ;Startup $oExcel = _ExcelBookNew() _ExcelWriteCell($oExcel,"Av Nikolas", 1,1) _ExcelWriteCell($oExcel,"Bruker data mellom 68 og 31165 som id",2,1) $url_Stub = "http://www.guildwarstrade.com/api/public/item?id=" $row_offset = 4-68 global $temp[10] main() func main() ;31165 for $i = 68 to 31165 step 1 retriver($i) next EndFunc func retriver($id) $string = InetRead($url_Stub & $id) $string = BinaryToString($string) if $string = "{}" Then $row_offset = $row_offset - 1 Return EndIf $string = StringTrimRight($string,1) $string = StringTrimLeft($string,1) $temp = StringSplit($string,",") $temp[1] = StringTrimLeft($temp[1],8) $temp[3] = StringTrimLeft($temp[3],7) Write($id,$temp) EndFunc func Write($id, $array) _ExcelWriteCell($oExcel,$id,1,4) _ExcelWriteCell($oExcel,$id,$row_offset + $id,1) _ExcelWriteCell($oExcel,$temp[1],$row_offset + $id,2) ;_ExcelWriteCell($oExcel,$temp[2],$row_offset + $id,3) _ExcelWriteCell($oExcel,$temp[3],$row_offset + $id,3) $profit = $temp[1]*0.85-$temp[3] _ExcelWriteCell($oExcel,$profit,$row_offset + $id,6) if $temp[3] = 0 Then _ExcelWriteCell($oExcel,0,$row_offset + $id,7) Return EndIf $up_p = $temp[1]*0.85-$temp[3] $dn_p = $temp[1] $profitpercent = round((Round($up_p)/($dn_p)*100),1) _ExcelWriteCell($oExcel,$profitpercent,$row_offset + $id,7) EndFunc

SQL... I know this SHOULD work, but never does, why?

$
0
0
The start of ANY SQL query within AUTOIT starts with the connection, and that's my problem. It NEVER works.



Global $adCN

$adCN = ObjCreate("ADODB.Connection")
$DSN = "DRIVER={SQL Server};SERVER=xxx;DATABASE=xxx;UID=xxx;PWD=xxx;"
$adCN.Open($DSN)

NEVER works for me.

I put in the right data in the fields above and get this no matter what I do..


Y:\AutoIT\SQL Test\sqltest.au3 (12) : ==> The requested action with this object has failed.:
$adCN.Open($DSN)
$adCN.Open($DSN)^ ERROR

The data is all correct and I'm running Scite ON the MDB server. So? It's Win Server 2008, SQL 2005,

New explorer window without new process?

$
0
0
I was wondering if it would be possible, in AutoIt, to launch a new explorer window without creating a new process. Right now, I'm using this:

ShellExecute("explorer.exe", $path)

This works wonderfully except for the fact that it creates a new explorer process every time it's executed.

If you for example look at the "WinKey + E" shortcut, you notice that no new processes are created however often you use the shortcut. I would like to have the same functionality. Would this be possible?

Help with Function Script

$
0
0
Hi guys I'm fairly new to Auto-It I understand the basics like mouse-click  sleep, winwaitactive() etc. and I'm attempting to move outward and start using hot-keys and functions but keep running into the same error.

Posted Image

here is the code

$Test = "{F1}"
HotKeySet($Test, "_Test")
Func "_Test" ($Test)
$A=0
Do
MouseClick("left",1119, 685, 2, 0)
$A=$A + 1
Until $A=1
$A=$A - 1
EndFunc


any help, tips and things I could do better will be gratefully appreciated thank you in advance. :D

what am I doing wrong?

$
0
0
What I would like is for this to slowly press 4 3 2 1 and pause when I take my finger off of 2 and restart from where it stopped.  So hold 2 and get 4 3 2 and if I let up on 2 it waits and then goes to 1 4 3... when I press 2 again.  Not sure where im screwing up.

[ autoit ]         
Do If _IsPressed("32") = 1 then Send("{4}") Sleep(Random(1500,1670,1)) Elseif _IsPressed("32") = 0 then Do Sleep(100) Until _isPressed("32") = 1 EndIf If _IsPressed("32") = 1 then Send("{3}") Sleep(Random(1500,1670,1)) Elseif _IsPressed("32") = 0 then Do Sleep(100) Until _isPressed("32") = 1 EndIf If _IsPressed("32") = 1 then Send("{2}") Sleep(Random(1500,1670,1)) Elseif _IsPressed("32") = 0 then Do Sleep(100) Until _isPressed("32") = 1 EndIf If _IsPressed("32") = 1 then Send("{1}") Sleep(Random(1500,1670,1)) Elseif _IsPressed("32") = 0 then Do Sleep(100) Until _isPressed("32") = 1 EndIf Until _IsPressed("23") Exit

FileRead - Windows XP vs Windows 8

$
0
0
So I had a miserable time reading a file on / creating a regular expression on windows 8, so I wrote just a simple test script to troubleshoot my Logic:

#include <IE.au3>
#include <Date.au3>
#include <Array.au3>
#include <String.au3>
#include <file.au3>
$i = 0
Local $file = "C:\foo\test.txt"
ConsoleWrite ("File name is: " & $file & @CRLF)
FileOpen($file,0)
consolewrite("FileOpen @error = " & @error & @CRLF)
If $file = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf
$file = FileRead("C:\foo\test.txt")
consolewrite("FileRead @Error = " & @error & @CRLF)
ConsoleWrite($file & @CRLF)
$test = StringRegExp($file, 'Acct', 3)

ConsoleWrite("Test " & $test[0] & @CRLF)



Couldn't get it to work, but had two existing scripts that used similar code, so I knew something was wrong.

Tested on a Windows XP VM, and everything worked as expected.

Anyone else having issues on Widnows 8, and workarounds?

File c:\foo\test.txt just has 2 lines of text:
Acct
Acct

Get present buttons of Installation Menu

$
0
0
Hi,
i want to program an Installation Script,

which scans the actual window for buttons which have some text (like NEXT, FINISH...).
So that i can implement a function which automaticly installs programms.
Example: So if there is a next button in the Window, press it.

HOW do I Scan for Buttons in the actual Window with the text value?

Thanks :)
Viewing all 12506 articles
Browse latest View live


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