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

Volume Leveler?

$
0
0

I managed to dig up some old movies from my old hard drive, Turns out that the background music isn't really background music at all.

What happens is that the voices of people are very soft and the "background" music is so loud that I have to turn my speakers down.

I came up with the idea to level the master volume and here it is:

AutoIt         
  1. HotKeySet("{ESC}", "_Exit")
  2.  
  3. Global $iLimit = 60 ; Limit in Db
  4.  
  5.     $iCurVol = _Function_To_Get_Current_Playback_Volume() ; Gets the current playback volume in Db (loudness)
  6.     If $iCurVol > $iLimit Then
  7.         Do
  8.             $iVol = _Function_To_Get_Master_Volume() ; Returns the master vol in %
  9.             _Function_To_Set_Master_Volume($iVol - 1) ; Sets the master vol in %
  10.         Until _Function_To_Get_Current_Playback_Volume() = $iLimit
  11.     ElseIf $iCurVol < $iLimit Then
  12.         Do
  13.             $iVol = _Function_To_Get_Master_Volume() ; Returns the master vol in %
  14.             _Function_To_Set_Master_Volume($iVol - 1) ; Sets the master vol in %
  15.         Until _Function_To_Get_Current_Playback_Volume() = $iLimit
  16.     EndIf
  17.     Sleep(100) ; Check every 100 ms to reduce CPU load
  18.  
  19. Func _Exit()
  20.     Exit
  21. EndFunc   ;==>_Exit

As you can see I need 3 functions:

  1. One to get the current DB of the playback volume
  2. A second one to get the master volume
  3. And a third one to set the master volume

Grid

$
0
0
Hello Everyone. It is possible to get the data from the gridview (in website). Thanks lot in advance.

cmd with varible

$
0
0

Hey all,

 

been having a bit of trouble, I need to run a cmd prompt then the following (note: line four needs to use the varible: $time)
 

set path=C:\Program Files\Microsoft Visual Studio\VSS\win32

set ssdir=\\button\home\VSS database

SET PROJECT= $/myfiles/

ss Add C:\locks\$time

Have you got any ideas, ive tried a couple of cmd ways but it starts entering the first line before cmd's even loaded so it only gets the second half of the line, and I dont know how to parse the variable into this.

So simple, but impossible for me! ActiveCell in excel with Autoit

$
0
0
Hello to everybody,
 
what I want to know is which row and which column is the active cell in the file excel.
I think it's really simple, but I've tried my best and I didn't succeed.
I haven't find anything in internet. Help me, please!  :sweating:
 
I use the file "test.xls" to write many records, but I want to know WHERE I'm writing the records BEFORE the records are written and before writing anything in the sheet.
The ActiveCell may be everywhere in the sheet.
 
 
#Include <Excel.au3>
$oExcel = _ExcelBookAttach("C:\test.xls")
 
$TheRow = $oExcel.ActiveCell.Row
 
The error is:
$TheRow = $oExcel.ActiveCell.Row
$TheRow = $oExcel.ActiveCell^ ERROR
 
Error: The requested action with this object has failed
 
Someone would correct my code, please?

SQL DB connection to autoit.

$
0
0

Hi All ,

 

I am facing an issue while connecting sql db with autoit . Actually I have tried all the solutions on this site but non of them worked .

 

Specification : 

 - Win 7

 - AutoIt V3

 - SciTE ( to wirte the code )

 - database (HeidiSql )

 

Now I have the following DB description :-

 - Schema Name - Vidit

 - DB name - vidit

 - Table Name - test .

   -  Columns name Datatype ( Int , Varchar , Varchar , Varchar , Varchar , Varchar )

 

Now I have data , which is stored in variable in SciTE , to be stored in the DB.

I have tried _SQLite function but bot able to to the task .

 

task :-

1. make connection .

2. store data in db.

4. Retrive data from db.

3. End connection .

 

Please Help me !! 

 

 

 

Recursive file/folder search - training exercise

$
0
0

I am new to the world of AutoIT and trying to get up to speed.  I am currently stuck on this exercise.

 

Recursive File Search:
 
Allow the user to specify a folder location to search for all files or folders
that contain a set of characters that they specify. Develop an easy-to-use way for the user to 
specify more than once search criteria, and also more than one search folder, and an effective method for outputting the results.
 
I have written the following which will return the contents of the initial folder and contents of the folders inside that folder but I am not sure how to proceed.
 
At some point in no longer returned the folder names in the array it creates, not sure where I went wrong.
 
Any help would be appreciated.
AutoIt         
#NoTrayIcon #include <Array.au3> Global $aSearch1[1], $i, $found $SearchFold = InputBox("", "Input the folder you want to search","C:\blablabla") $SearchString = InputBox("", "Input value you want to search for", "*.*") ;~ $SearchString = "*" & $SearchString & "*" _FileSearch( $SearchFold, $SearchString ) _ArrayDisplay( $aSearch1, "Search Results" ) $i = 0 Func _FileSearch( $startfold, $searchval )   ; declares function FileChangeDir($startfold)      ; changes the working directory,  directory is being searched     $search = FileFindFirstFile( $searchval ) If $search = -1 Then                       ; Check if the search was successful     MsgBox(0, "Error", "No files/directories matched the search pattern")     Exit EndIf While 1     $file = FileFindNextFile( $search )     If @error Then ExitLoop     $found = $startfold & "\" & $file       $dirchk = StringInStr(FileGetAttrib($found), "D" ) ;directory check         Select             Case  $dirchk > 0                 _FileSearch( $found, $searchval ) ;recurse if directory found             Case $dirchk = 0                 $found = $startfold & "\" & $file   ;return $found if not a directory         EndSelect     $aSearch1[$i] = $found  ;write found to the array     $i = $i + 1               ;increase the value of $i     ReDim $aSearch1[$i +1]    ;redim the array WEnd ReDim $aSearch1[UBound( $aSearch1 ) -1]  ;trim the array $i = UBound($aSearch1) -1 FileClose($search)   ; Close the search handle EndFunc
 
 

AutoIt vs. PowerShell

$
0
0

Hello Everyone,

 

I know that this is an AutoIt forum and that everyone here loves AutoIt (as I do). But, I was hoping that some of you whom might have experience with PowerShell could provide me with a more objective comparison as to whether it makes more sense to use AutoIt or PowerShell as my primary "wrapper" for driving all of the software deployments within my company. Currently, I'm using VBScript for my "wrapper" template, but I'm seriously thinking about switching to either AutoIt or PowerShell.

 

Which one should I use and why?

Auto Login Bot Returning $_IEStatus_NoMatch

$
0
0

Hello all, 

 

I am a longtime AutoIT tinkerer, first time poster.

 

I am trying to write a script to enter me into a drawing once daily. When I run the code below, I get the following notifications (see below). I used the Chrome Element Inspector to get the element names and there are not duplicates of the element names, so that's not the problem. My only guess is that the webpage being a .php is somehow causing problems. Any help would be greatly appreciated!

 

Thanks,

Fred

#include <IE.au3> Call("SignIn") Func SignIn()     Global $oIE = _IECreate("http://penn-station.com/summergift2013.php")     Local $Username = _IEGetObjByName($oIE, "Name")     Local $Password = _IEGetObjByName($oIE, "Email")     _IEFormElementSetValue($Username, "User")     _IEFormElementSetValue($Password, "Pass") EndFunc   ;==>SignIn
 
"...
--> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: Name, Index: 0)
--> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: Email, Index: 0)
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
--> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType
+>14:17:23 AutoIt3.exe ended.rc:0
>Exit code: 0    Time: 1.657"
 

Script that detect if the language is English or not -need help-

$
0
0

Hi all

 

i want to make a auto it script that detect a language of a place on the screen, (maybe i make it copy a part of the text and user google translate to detect language ?)

i want it to detect one language (English)

i don't want the characters i only want it to detect if the language is English or not

 

i an new to Autoit and my knowledge is so limited can any one put me in the direct way ?

Read Label Text from ThunderRT6UserControlDC

$
0
0

Hello, is there a way to read the visible label text from a ThunderRT6UserControlDC control?  Apparently, it's not window text.  I used window detective to identify the font style, but just not the label text.  Thank you so much for your help.

Combining Variable problems

$
0
0
When I hit button 1 the data it provides is 
 ' & $GlobalVar8 & '' & $GlobalVar1 & '' & $GlobalVar2 & '' & $GlobalVar3 & '' & $GlobalVar9 & '' & $GlobalVar4 & '' & $GlobalVar5 & '' & $GlobalVar6 & '' & $GlobalVar7 & '
Not the input data that is provided from the gui. I have tried to find examples and have tried this line as well with no luck.
$CompName=$GlobalVar8 & $GlobalVar1 & $GlobalVar2 & $GlobalVar3 & $GlobalVar9 & $GlobalVar4 & $GlobalVar5 & $GlobalVar6 & $GlobalVar7
 
How can I call all these variables together?
 
 
$GlobalVar1 = GUICtrlRead($GlobalInput1, 1)
$GlobalVar2 = GUICtrlRead($GlobalInput2, 1)
$GlobalVar3 = GUICtrlRead($GlobalInput3, 1)
$GlobalVar4 = GUICtrlRead($GlobalInput4, 1)
$GlobalVar5 = GUICtrlRead($GlobalInput5, 1)
$GlobalVar6 = GUICtrlRead($GlobalInput6, 1)
$GlobalVar7 = GUICtrlRead($GlobalInput7, 1)
$GlobalVar8=("S")
 
ElseIf $GlobalInput1 = 0 And $GlobalInput2 = 9 And $GlobalInput3 = 9 Then
$GlobalVar9 = ("UAS")
 
ElseIf $GlobalInput1 <> "0" And $GlobalInput2 <> "9" And $GlobalInput3 <> "9" Then
$GlobalVar9 = ("POS")
 
 
$GlobalInput1 = GUICtrlCreateInput( "", 90, 110, 20, 24)
GUICtrlSetBkColor( -1, 0xFF0000)
$GlobalInput2 = GUICtrlCreateInput( "", 90, 110, 20, 24)
GUICtrlSetBkColor( -1, 0xFF0000)
$GlobalInput3 = GUICtrlCreateInput( "", 120, 110, 20, 24)
GUICtrlSetBkColor( -1, 0xFF0000)
$GlobalInput4 = GUICtrlCreateInput( "", 150, 110, 20, 24)
GUICtrlSetBkColor( -1, 0xFF0000)
$GlobalInput5 = GUICtrlCreateInput( "", 121, 140, 20, 24)
GUICtrlSetBkColor( -1, 0xFF0000)
$GlobalInput6 = GUICtrlCreateInput( "", 150, 140, 20, 24)
GUICtrlSetBkColor( -1, 0xFF0000)
$GlobalInput7 = GUICtrlCreateInput( "", 181, 140, 20, 24)
GUICtrlSetBkColor( -1, 0xFF0000)
 
 
Func Button1Click()
 
$CompName =  ' & $GlobalVar8 & '' & $GlobalVar1 & '' & $GlobalVar2 & '' & $GlobalVar3 & '' & $GlobalVar9 & '' & $GlobalVar4 & '' & $GlobalVar5 & '' & $GlobalVar6 & '' & $GlobalVar7 & '
 
    RegWrite ("HKEY_USERS\.Default\Software\Microsoft\Windows Media\WMSDK\General", "Computername", "REG_SZ", $CompName)
 
EndFunc

ListBox Delete Selections - Is ListBox What I should Use?

$
0
0

Hi,

 

What I want is an uneditable "box" that shows records (rows of text). Through Autoit magic the user adds row(s) and hopefully can delete row(s), but the content of the rows are not editable.

 

I'd like to have mouse right click copy and delete (but not paste). ..But the listbox seems OK, Through buttons a user can add and delete. And row text can't be edited (at least by default) so it's cool.

 

But I can't get deletion working right. I want single row and multiple row deletion ( the user is able to select multiple rows) via  *one* " delete" button on the GUI. The code works weirdly for multiple deletes, after a multiple delete is made then a line gets selected for no apparent reason and futher delete attempts give unexpected results. (It's not apparent and unexpected to me only because I don't get what the problem is). Thanks, help appreciated.

 

#include <GUIConstantsEx.au3>
#include <FF.au3>
#include <Array.au3>
#include <GuiListBox.au3>
#include <StaticConstants.au3>
#include <DateTimeConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Date.au3>

 

snip....

 

$mylist = GUICtrlCreateList("", 200, 32, 320, 260, $LBS_EXTENDEDSEL)

 

snip...

 

        Case $msg = $delrowurl ; one delete button for single and multiple selections
            $sItems = _GUICtrlListBox_GetSelItems($mylist)
            ConsoleWrite('  ' & $sItems[0] & @LF)
            If $sItems[0] = 1 Then
                _GUICtrlListBox_DeleteString($mylist, _GUICtrlListBox_GetCurSel($mylist))
            ElseIf $sItems[0] > 1 Then
                For $sli = 1 To UBound($sItems) - 1
                    ConsoleWrite(' ' & $sli & ' ')
                    _GUICtrlListBox_DeleteString($mylist, $sli)
                Next
            EndIf
....

 

 

 

Help with comment script

$
0
0

I am trying to create a script that has the ability to visit a YouTube video and post a comment on my behalf. I am able to get the script to write text in the comment box, but I can not get the script to click the post button. 

 

This is what I have so far. 

 

_IENavigate($mIE, "http://www.youtube.com/watch?v=BNb62NBYvGU") _IELoadWait($mIE) $oForm = _IEGetObjByName($mIE,"comment") _IEAction($oForm, "focus") _IEFormSubmit($oForm) $oSubmit = _IEGetObjByName($mIE,"add_comment") _IEFormElementSetValue($oForm,"Thanks") _IEAction($oSubmit,"click")
 

Thank you for your time. 

 

MYSQL: update query

$
0
0

Hello everybody,
I wondering if somebody could check/help me with this code.
I am trying to do an update query with mysql.

When I use this code nothing is happening and no error

AutoIt         
    If $OPT_TestResults = 1 then             If Not _EzMySql_Startup() Then                 MsgBox(0, "Error Starting MySql", "Error: "& @error & @CR & "Error string: " & _EzMySql_ErrMsg())                     Exit             EndIf ; READ connection values from ini file                     Global $config_file  = @ScriptDir & "\etc\config.ini"                     Global $extractfile = IniRead($config_file, "NEMO", "extractfile","")                     Global $User = IniRead($config_file, "NEMO", "Username","")                     Global $Pass = IniRead($config_file, "NEMO", "Password","")                     Global $Database = IniRead($config_file, "NEMO", "Database","")                     Global $MySQLServerName = IniRead($config_file, "NEMO", "mysqlservername","")                         _EzMySql_Open($MySQLServerName, $User, $Pass, $Database)                         $aOK = "update richiest set flgpreana='I' where flgstatu IN ('I','L');"                         ;_EzMySql_Exec($aOK)                         $number = _EzMySql_FetchNames()                         MsgBox(64, "Update information: ", "Total number of records that where send:       " &  $number, 10)         EndIf

Many thanks for all your help..

 

Kindly regards

Koen

 

Kill Process

$
0
0
Well I have a following doubts when I will finish the process of any one software, works fine with my code more when I finish something more important to know it, sv, winlogon, antivirus, etc. gives access denied
someone could help me to change the Perm or soft do that something?

Fix problem

$
0
0

Hello everyone, now i have done my script, but it works, but not everytime because of the software which is in my picture:

 

ix1l.png

 

So, sometimes i am getting this error, and i dont know how to make loop, that could check if this error exist, or not, because there isnt any title or anything, maybe with the class, but there isnt any title.. now i am using two scripts: First runing this one:

AutoIt         
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <FF.au3> Opt("WinTitleMatchMode", 2) sleep(15000) WinActivate("StrongVPN Client - 1.2.2+35c10f")     Send("{ENTER}")       sleep(30000) WinActivate("StrongVPN Client - 1.2.2+35c10f") ControlClick("StrongVPN Client - 1.2.2+35c10f", "", "[CLASS:WindowsForms10.BUTTON.app.0.33c0d9d]")   sleep(3000)   run("C:\Documents and Settings\Administrator\Desktop\SCRIPT.exe")   sleep(55000)   if NOT WinExists("Mixxx - The Virtual DJ - Mozilla Firefox") Then     WinActivate("StrongVPN Client - 1.2.2+35c10f")     sleep(1000)  MouseClick("left", 403, 342, 1, 0) ; Accept      WinActivate("StrongVPN Client - 1.2.2+35c10f")     sleep(1000)  MouseClick("left", 403, 342, 1, 0) ; Accept      WinActivate("StrongVPN Client - 1.2.2+35c10f")     sleep(1000)  MouseClick("left", 403, 342, 1, 0) ; Accept       WinActivate("StrongVPN Client - 1.2.2+35c10f")     ControlClick("StrongVPN Client - 1.2.2+35c10f", "", "[CLASS:WindowsForms10.BUTTON.app.0.33c0d9d]")   sleep(9000)   WinActivate("Firefox")   ProcessClose("FileIce.exe")   run("C:\Documents and Settings\Administrator\Desktop\SCRIPT.exe")   endif  

Which are runing VPN software, then it runs my main and primary script, but i wish to make it correctly run vpn first without any error then just run my primary scrip.. Above is what i tried to do, but i am keep getting this error still... 

[Request]Merging 2 scripts

$
0
0

Dear Forum  Users , 

trying to get 2 scripts to work under one script with a little Edit on the script itself to show additional info which is posted on the second script "Monitor Info"

 

so instead of show 2 windows it would be just one

 

1st script

AutoIt         
#RequireAdmin #include <Array.au3> Global $PCName = @ComputerName Dim $StrSerial ="Serial Number :" Global $aArray = _IPDetails() Global $sData = "IP Address: " & $aArray[1] & @LF & _ "MAC Address: " & $aArray[2] $ObjWMI = ObjGet("winmgmts:") $ColSettingsBios = $ObjWMI.ExecQuery("Select * from Win32_BIOS") For $ObjComputer in $ColSettingsBios $StrSerial = $StrSerial & $ObjComputer.SerialNumber Next MsgBox(0,"PC Information Made by Eng.Abdulrhman Mal","PC Name = " & $PCName & @LF& $sData & @LF& $StrSerial) Func _IPDetails()     Local $oWMIService = ObjGet("winmgmts:")     Local $oColItems = $oWMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True", "WQL", 0x30), $aReturn[5] = [4]     If IsObj($oColItems) Then         For $oObjectItem In $oColItems             If $oObjectItem.IPAddress(0) == @IPAddress1 Then                 $aReturn[1] = $oObjectItem.IPAddress(0)                 $aReturn[2] = $oObjectItem.MACAddress(0)                EndIf         Next         Return $aReturn     EndIf     Return SetError(1, 0, $aReturn) EndFunc   ;==>_IPDetails $Result = StringLen($StrSerial) IF $Result > 15 Then $StrSerial = StringLeft ( $StrSerial, 15 ) EndIf ;$ComputerDescription = InputBox("Information Needed", "Please enter the computer description", "") $ComputerName = InputBox("Information Needed", "Please enter the computer Name", "") ;MsgBox(0, "notice", $ComputerDescription) ShellExecute("sysdm.cpl") WinWait("System Properties") WinWaitActive("System Properties","To use a wizard to join a domain or workgroup") ;Send($ComputerDescription) ;Send("!A") Send("!C") WinWait("Computer Name/Domain Changes", "You can change the name and") WinWaitActive("Computer Name/Domain Changes", "You can change the name and") Send("!C") Send( "UJC-00"&$ComputerName) Send("!D") Send("{TAB}") Send("domain name xxxx") Send("{ENTER}") WinWait("Windows Security", "OK") WinWaitActive("Windows Security", "OK") Send("joind") Send("{TAB}") Send("joinadmin") Send("{TAB}") Send("{ENTER}") WinWait("Computer Name/Domain Changes", "Welcome to the GRG domain.") WinWaitActive("Computer Name/Domain Changes", "Welcome to the GRG domain.") Send("{ENTER}") Sleep(15000) if WinExists("Computer Name/Domain Changes", "OK") Then     Send("{ENTER}") EndIf ;if WinExists("Computer Name/Domain Changes", "OK") Then ;   Send("{ENTER}") ;   msgbox(0,"window does exist", "line46") ;EndIf WinWait("System Properties", "To use a wizard") WinActivate("System Properties", "To use a wizard") WinWaitActive("System Properties","To use a wizard") msgbox(0,"window","the window is active") ControlClick("System Properties", "To use a wizard", "Button3") Send("{ENTER}") ;msgbox(0,"pause", "pause here 3") ;WinWait("Computer Name/Domain Changes", "You can change the name and the membership") ;WinWaitActive("Computer Name/Domain Changes", "You can change the name and the membership") ;Send("{ENTER}") ;msgbox(0,"pause", "pause here 4") ;WinWait("System Properties", "To rename this computer or change its domain") ;WinWaitActive("System Properties", "To rename this computer or change its domain") ;Send("{ENTER}") ;WinWait("Computer Name/Domain Changes", "OK") ;WinWaitActive("Computer Name/Domain Changes", "OK") ;Send("{ENTER}") WinWait("Microsoft Windows", "&Restart Now") WinWaitActive("Microsoft Windows", "&Restart Now") Send("!R")

2nd script  "Monitor"


AutoIt         
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;Retrieve Monitor Model and Serial ;13 November 2005 by Geert (NL) ;used parts made by archrival (http://www.autoitscript.com/forum/index.php?showtopic=11136) ;Edited by rover 18 June 2008 ;Collect EDID strings for all active monitors Opt("MustDeclareVars", 1) ; ConsoleWrites slow a script if not needed Global $Debug = True ; change to False or comment out/remove ConsoleWrite() lines if debugging to console not needed Global $iCounterEDID = 0 Global $asEDID[1], $edidarray[1], $error1, $error2, $error3 Global $iCounterMonitorName = 1, $iCounterMonitorCode, $iCounterMonitorControlFolder Global $sMonitorName, $sMonitorCode, $sMonitorControlFolder, $sMonitorEDIDRead, $ser, $name, $j Do $sMonitorName = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY", $iCounterMonitorName) $error1 = @error If $Debug Then ConsoleWrite(@CRLF & '@@ Debug(' & @ScriptLineNumber & ') : $sMonitorName = ' & _ StringStripWS($sMonitorName, 2) & @CRLF & '>Error code: ' & $error1 & @CRLF) If $sMonitorName <> "" Then $iCounterMonitorCode = 1 Do ; Search 'monitor code' - e.g. 5&3aba5caf&0&10000080&01&00 $sMonitorCode = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _ $sMonitorName, $iCounterMonitorCode) $error2 = @error If $Debug Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sMonitorCode = ' & _ StringStripWS($sMonitorCode, 2) & @CRLF & '>Error code: ' & $error2 & @CRLF) ; Search Control folder - When available, the active monitor is found $iCounterMonitorControlFolder = 1 Do $sMonitorControlFolder = RegEnumKey("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _ $sMonitorName & "\" & $sMonitorCode, $iCounterMonitorControlFolder) $error3 = @error If $Debug Then ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $sMonitorControlFolder = ' & _ StringStripWS($sMonitorControlFolder, 2) & @CRLF & '>Error code: ' & $error3 & @CRLF) If $sMonitorControlFolder == "Control" Then; Active monitor found! Switch RegEnumVal("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & $sMonitorName & _ "\" & $sMonitorCode & "\Device Parameters", 1) Case "EDID" $sMonitorEDIDRead = RegRead("HKLM\SYSTEM\CurrentControlSet\Enum\DISPLAY\" & _ $sMonitorName & "\" & $sMonitorCode & "\Device Parameters", "EDID") If $sMonitorEDIDRead <> "" Then $iCounterEDID += 1 $asEDID[0] = $iCounterEDID ReDim $asEDID[UBound($asEDID) + 1] $asEDID[UBound($asEDID) - 1] = $sMonitorEDIDRead; Add found EDID string to Array EndIf Case "BAD_EDID" $iCounterEDID += 1 $asEDID[0] = $iCounterEDID ReDim $asEDID[UBound($asEDID) + 1] $asEDID[UBound($asEDID) - 1] = "BAD_EDID"; Add BAD_EDID string to Array Case Else EndSwitch EndIf $iCounterMonitorControlFolder += 1; Increase counter to search for next folder Until $error3 <> 0 $iCounterMonitorCode += 1; Increase counter to search for next 'monitor code' folder Until $error2 <> 0 EndIf $iCounterMonitorName += 1; Increase counter to search for next monitor Until $error1 <> 0 ; Decrypt collected EDID strings - Thanks archrival For $k = 1 To $asEDID[0] Switch $asEDID[$k] Case "" $ser = "" $name = "" Case "BAD_EDID" $ser = "BAD_EDID" $name = "BAD_EDID" Case Else $j = 0 Dim $edidarray[StringLen($asEDID[$k])] $edidarray[0] = (StringLen($asEDID[$k]) / 2) + 1 For $i = 1 To StringLen($asEDID[$k]) Step 2 $j += 1 $edidarray[$j] = Dec(StringMid($asEDID[$k], $i, 2)) Next $ser = StringStripWS(_FindMonitorSerial(), 1 + 2) $name = StringStripWS(_FindMonitorName(), 1 + 2) EndSwitch ;Show MonitorSerial & MonitorName: no info? -> Your using a notebook right! MsgBox(64, "Monitor " & $k, "MonitorSerial: " & @TAB & _ $ser & @CRLF & "MonitorName: " & @TAB & $name) Next #region - Functions Func _FindMonitorSerial(); Thanks archrival Local $sernumstr = "", $sernum = 0, $endstr For $i = 1 To (UBound($edidarray) / 2) - 4 If $edidarray[$i] = "0" And $edidarray[$i + 1] = "0" And $edidarray[$i + 2] = "0" _ And $edidarray[$i + 3] = "255" And $edidarray[$i + 4] = "0" Then $sernum = $i + 4 EndIf Next If $sernum <> 0 Then $endstr = 0 For $i = 1 To 13 If $edidarray[$sernum + $i] = "10" Then $endstr = 1 Else If $endstr = 0 Then $sernumstr &= Chr($edidarray[$sernum + $i]) EndIf EndIf Next EndIf Return $sernumstr EndFunc ;==>_FindMonitorSerial Func _FindMonitorName(); Thanks archrival Local $n = 0, $namestr = "", $endstr For $i = 1 To (UBound($edidarray) / 2) - 4 If $edidarray[$i] = "0" And $edidarray[$i + 1] = "0" And _ $edidarray[$i + 2] = "252" And $edidarray[$i + 3] = "0" Then $n = $i + 3 EndIf Next If $n <> 0 Then $endstr = 0 For $i = 1 To 13 If $edidarray[$n + $i] = "10" Then $endstr = 1 Else If $endstr = 0 Then $namestr &= Chr($edidarray[$n + $i]) EndIf EndIf Next EndIf Return $namestr EndFunc ;==>_FindMonitorName #endregion

your help is appreciated 

 

How to change tab and other properties?

$
0
0

As an example,If I want my script to open in Win 7

Control Panel\System and Security\System>Advanced System Settings>Performance>Settings>Adjust for best performance

 

Which variables I need to use?

Problem with PSEXEC.EXE, ControlSetText on Windows Server 2008 R2

$
0
0

Hi,

 

I am trying to use an AutoIt application run from PSEXEC.EXE on a Windows 2008 R2 server but have come across a problem with ControlSetText().

 

The Windows 2008 R2 server has User Account Control (UAC) disabled.

 

The problem can be demonstrated with the following AutoIt code.  Compile the following AutoIT to an executable, say "test.exe".

 

WinActivate("[CLASS:Notepad]") WinWaitActive("[CLASS:Notepad]") ControlSetText("[CLASS:Notepad]", "", "Edit1", "This is some test text")  

 

On the 2008 R2 server start two cmd.exe A and B.

 

On cmd.exe A, type the following

 

  psexec.exe \\127.0.0.1 -u <username> -p <password> -i 1 cmd.exe

 

using the same username and password as used to login.

Another cmd.exe window C appears.

 

Now start notepad on cmd.exe B.

 

  notepad.exe

 

Run the AutoIt script from cmd.exe C

 

  test.exe

 

and no text appears in the the notepad window.

 

Run the same AutoIt script from cmd.exe B

 

  test.exe

 

and the text "This is some test text" is written to notepad.

 

Quit notepad and now start it again but this time from cmd.exe C.

 

This time the application test.exe only works if run from cmd.exe C. It seems to be a permissions problem but I can find no difference in permissions between cmd.exe B and C.  Does anyone have any ideas what the problem might be?

 

Set hotkey an ASCII Character

$
0
0

Hello autoit forum , my z button broken so i want to press "<" key to send "z" character.But i could not.

 

I tried this ;

$Key = Chr(60) HotKeySet($Key,"z") Func z() Send("z") EndFunc while 1     Sleep(10) WEnd

I can send "<" key with this code but cant set to hotkey

$Key = Chr(60) Send($Key)

Cheers Loken ;)

Viewing all 12506 articles
Browse latest View live


Latest Images

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