Leaderboard
Popular Content
Showing content with the highest reputation on 05/16/2017 in all areas
-
By using \b to request word boundary before and after \d+ you can get what I believe you're after. #include <array.au3> $aArray = StringRegExp('Java 3009 Update 1a21', '(?i)Java (\b\d+\b) Update (\b\d+\b)', $STR_REGEXPARRAYGLOBALMATCH) _ArrayDisplay($aArray) $aArray = StringRegExp('Java 3z09 Update 1a21', '(?i)Java (\b\d+\b) Update (\b\d+\b)', $STR_REGEXPARRAYGLOBALMATCH) _ArrayDisplay($aArray) $aArray = StringRegExp('Java 3009 Update 1521', '(?i)Java (\b\d+\b) Update (\b\d+\b)', $STR_REGEXPARRAYGLOBALMATCH) _ArrayDisplay($aArray) Note nevertheless that \b relies on the PCRE definition of "word characters", i.e. [0-9A-Za-z_] where the underscore IS a word letter.2 points
-
Hey guys! Here are some informations on how to automate AS400 tasks with AutoIT. AS400 are mainframes made by IBM and used mainly in professional workplaces. First you need to launch an IBM Iseries console to the AS400. It looks like this: As it is a regular window, you can use the "AutoIT Window Info" tool and functions like "ControlSetText", "ControlClick" to automate the login process. Notice that the name of the window (in the top left of the above screenshot) is "Session A". This is because it is the first Iseries window that is opened on the client computer. If you do not close it and open another one, the next one will be named "Session B". The third one "Session C"... Once you're logged into the Iseries console interface, the OS400 login window shows up: Use this code to create an autoIT object linked to the iseries console: global $oOIA = ObjCreate("PCOMM.autECLOIA") $oOIA.SetconnectionByName("A") global $oPS = ObjCreate("PCOMM.autECLPS") $oPS.SetConnectionByName("A") The letter "A" is a reference to the name of the session displayed in the iseries console window, as explained before. Change it to another letter if you have multiples iseries console windows opened at the same time. Then there are 3 main functions that you can use to interact with the interface: $oOIA.WaitForInputReady() ;waits for the interface to be ready for input. $oPS.SetCursorPos(6, 53) ;put the cursor of the interface to position X = 6, Y = 53 $oPS.SendKeys("hello world[enter]") ;write the text "hello world" where the cursor of the interface is then press the enter/return key $result = $oPS.SearchText("banana") ;search for the text "banana" on the interface screen. Returns "True" if found, "False" if not. The function "WaitForInputReady" is badfully not very reliable. For better results, use the fuction "SearchText" in a while loop to wait for a specific text to appear on the interface if you want to be sure that the interface is ready for input. With these 3 functions you can pretty much do anything you would do manually on an Iseries console. Special keys for the "SendKeys" function can be found using the virtual keyboard included in the iseries console software. Enjoy Original post (credit to @DangerousDan and @bwochinski) for helping me understand the above stuff ^^):1 point
-
Ever wondered how to interact with your compiled .NET assembly and AutoIt script using COM? Then look no further, as I try to explain in simple terms the approach at which to achieve this. The code (AutoIt): As quite a few of you know, I am against the use of Global variables, as more often than not a simple approach such as encapsulating a Local Static variable in a wrapper function is just as good. Some may point out the use of the enumeration, but this is only for the purposes of doing away with "magic numbers", with the chances to expand in the future and not having to remember which number represents what etc... To create the .NET dll: In Visual Studio select a new project and class library. From there, go ahead and rename the namespace and class to something meaningful as you will need it later on when you connect to the COM interface of your .NET assembly. Add [ComVisible(true)] above the class declaration line << IMPORTANT. Once you've added all your wonderful C# related code, build the assembly and copy the .dll file to the location of your AutoIt script. Then it's just as simple as calling the _DotNet_Load() function with the filename of the .dll and voila, you have the power of AutoIt and .NET in one script. Example use of Functions: #include <File.au3> Global Const $DOTNET_PATHS_INDEX = 0, $DOTNET_REGASM_OK = 0 Global Enum $DOTNET_LOADDLL, $DOTNET_UNLOADDLL, $DOTNET_UNLOADDLLALL ; Enumeration used for the _DotNet_* functions. Global Enum $DOTNET_PATHS_FILEPATH, $DOTNET_PATHS_GUID, $DOTNET_PATHS_MAX ; Enumeration used for the internal filepath array. #cs NOTE: Don't forget to add [ComVisible(true)] to the top of the class in the class library. Otherwise it won't work. #ce Example() ; A simple example of registering and unregistering the AutoIt.dll Func Example() If _DotNet_Load('AutoIt.dll') Then ; Load the .NET compiled dll. Local $oPerson = ObjCreate('AutoIt.Person') ; Namespace.Class. If IsObj($oPerson) Then $oPerson.Name = "guinness" $oPerson.Age = Random(18, 99, 1) ConsoleWrite('Person''s age => ' & $oPerson.Age & @CRLF) $oPerson.IncreaseAge() ; A silly method to show the encapsulation of the object around the Age property. ConsoleWrite('Person''s new age => ' & $oPerson.Age & @CRLF) ConsoleWrite($oPerson.ToString() & @CRLF) ; Call the ToString() method which was overriden. Else ConsoleWrite('An error occurred when registering the Dll.' & @CRLF) EndIf Else ConsoleWrite('An error occurred when registering the Dll.' & @CRLF) EndIf ; The dll is automatically unloaded when the application closes. EndFunc ;==>Example ; #FUNCTION# ==================================================================================================================== ; Name ..........: _DotNet_Load ; Description ...: Load a .NET compiled dll assembly. ; Syntax ........: _DotNet_Load($sDllPath) ; Parameters ....: $sDllPath - A .NET compiled dll assembly located in the @ScriptDir directory. ; $bAddAsCurrentUser - [optional] True or false to add to the current user (supresses UAC). Default is False, all users. ; Return values .: Success: True ; Failure: False and sets @error to non-zero: ; 1 = Incorrect filetype aka not a dll. ; 2 = Dll does not exist in the @ScriptDir location. ; 3 = .NET RegAsm.exe file not found. ; 4 = Dll already registered. ; 5 = Unable to retrieve the GUID for registering as a current user. ; Author ........: guinness ; Remarks .......: With ideas by funkey for running under the current user. ; Example .......: Yes ; =============================================================================================================================== Func _DotNet_Load($sDllPath, $bAddAsCurrentUser = Default) If $bAddAsCurrentUser = Default Then $bAddAsCurrentUser = False Local $bReturn = __DotNet_Wrapper($sDllPath, $DOTNET_LOADDLL, $bAddAsCurrentUser) Return SetError(@error, @extended, $bReturn) EndFunc ;==>_DotNet_Load ; #FUNCTION# ==================================================================================================================== ; Name ..........: _DotNet_Unload ; Description ...: Unload a previously registered .NET compiled dll assembly. ; Syntax ........: _DotNet_Unload($sDllPath) ; Parameters ....: $sDllPath - A .NET compiled dll assembly located in the @ScriptDir directory. ; Return values .: Success: True ; Failure: False and sets @error to non-zero: ; 1 = Incorrect filetype aka not a dll. ; 2 = Dll does not exist in the @ScriptDir location. ; 3 = .NET RegAsm.exe file not found. ; Author ........: guinness ; Remarks .......: With ideas by funkey for running under the current user. ; Example .......: Yes ; =============================================================================================================================== Func _DotNet_Unload($sDllPath) Local $bReturn = __DotNet_Wrapper($sDllPath, $DOTNET_UNLOADDLL, Default) Return SetError(@error, @extended, $bReturn) EndFunc ;==>_DotNet_Unload ; #FUNCTION# ==================================================================================================================== ; Name ..........: _DotNet_UnloadAll ; Description ...: Unload all previously registered .NET compiled dll assemblies. ; Syntax ........: _DotNet_UnloadAll() ; Parameters ....: None ; Return values .: Success: True ; Failure: False and sets @error to non-zero: ; 1 = Incorrect filetype aka not a dll. ; 2 = Dll does not exist in the @ScriptDir location. ; 3 = .NET RegAsm.exe file not found. ; 4 = Dll already registered. ; 5 = Unable to retrieve the GUID for registering as a current user. ; Author ........: guinness ; Remarks .......: With ideas by funkey for running under the current user. ; Example .......: Yes ; =============================================================================================================================== Func _DotNet_UnloadAll() Local $bReturn = __DotNet_Wrapper(Null, $DOTNET_UNLOADDLLALL, Default) Return SetError(@error, @extended, $bReturn) EndFunc ;==>_DotNet_UnloadAll ; #INTERNAL_USE_ONLY# =========================================================================================================== ; Name ..........: __DotNet_Wrapper ; Description ...: A wrapper for the _DotNet_* functions. ; Syntax ........: __DotNet_Wrapper($sDllPath, $iType) ; Parameters ....: $sDllPath - A .NET compiled dll assembly located in the @ScriptDir directory. ; $iType - A $DOTNET_* constant. ; Return values .: Success: True ; Failure: False and sets @error to non-zero: ; 1 = Incorrect filetype aka not a dll. ; 2 = Dll does not exist in the @ScriptDir location. ; 3 = .NET RegAsm.exe file not found. ; 4 = Dll already registered. ; 5 = Unable to retrieve the GUID for registering as current user. ; Author ........: guinness ; Remarks .......: ### DO NOT INVOKE, AS THIS IS A WRAPPER FOR THE ABOVE FUNCTIONS. ### ; Remarks .......: With ideas by funkey for running under the current user. ; Related .......: Thanks to Bugfix for the initial idea: http://www.autoitscript.com/forum/topic/129164-create-a-net-class-and-run-it-as-object-from-your-autoit-script/?p=938459 ; Example .......: Yes ; =============================================================================================================================== Func __DotNet_Wrapper($sDllPath, $iType, $bAddAsCurrentUser) Local Static $aDllPaths[Ceiling($DOTNET_PATHS_MAX * 1.3)][$DOTNET_PATHS_MAX] = [[0, 0]], _ $sRegAsmPath = Null If Not ($iType = $DOTNET_UNLOADDLLALL) Then If Not (StringRight($sDllPath, StringLen('dll')) == 'dll') Then ; Check the correct filetype was passed. Return SetError(1, 0, False) ; Incorrect filetype. EndIf If Not FileExists($sDllPath) Then ; Check the filepath exists in @ScriptDir. Return SetError(2, 0, False) ; Filepath does not exist. EndIf EndIf If $sRegAsmPath == Null Then $sRegAsmPath = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework', 'InstallRoot') If @error Then $sRegAsmPath = '' ; Set to an empty string to acknowledge that searching for the path happened. Else Local $aFilePaths = _FileListToArray($sRegAsmPath, '*', $FLTA_FOLDERS), _ $sNETFolder = '' If Not @error Then For $i = UBound($aFilePaths) - 1 To 1 Step -1 If StringRegExp($aFilePaths[$i], '(?:[vV]4\.0\.\d+)') Then $sNETFolder = $aFilePaths[$i] ExitLoop ElseIf StringRegExp($aFilePaths[$i], '(?:[vV]2\.0\.\d+)') Then $sNETFolder = $aFilePaths[$i] ExitLoop EndIf Next EndIf $sRegAsmPath &= $sNETFolder & '\RegAsm.exe' If FileExists($sRegAsmPath) Then OnAutoItExitRegister(_DotNet_UnloadAll) ; Register when the AutoIt executable is closed. Else $sRegAsmPath = '' ; Set to an empty string to acknowledge that searching for the path happened. EndIf EndIf EndIf If $sRegAsmPath == '' Then Return SetError(3, 0, False) ; .NET Framework 2.0 or 4.0 required. EndIf Switch $iType Case $DOTNET_LOADDLL Local $iIndex = -1 For $i = $DOTNET_PATHS_MAX To $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] If $sDllPath = $aDllPaths[$i][$DOTNET_PATHS_FILEPATH] Then Return SetError(4, 0, False) ; Dll already registered. EndIf If $iIndex = -1 And $aDllPaths[$i][$DOTNET_PATHS_FILEPATH] == '' Then $iIndex = $i ExitLoop EndIf Next If $iIndex = -1 Then $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] += 1 $iIndex = $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] EndIf Local Const $iUBound = UBound($aDllPaths) If $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] >= $iUBound Then ReDim $aDllPaths[Ceiling($iUBound * 1.3)][$DOTNET_PATHS_MAX] EndIf $aDllPaths[$iIndex][$DOTNET_PATHS_FILEPATH] = $sDllPath $aDllPaths[$iIndex][$DOTNET_PATHS_GUID] = Null If $bAddAsCurrentUser Then ; Idea by funkey, with modification by guinness. Local $sTempDllPath = @TempDir & '\' & $sDllPath & '.reg' If Not (RunWait($sRegAsmPath & ' /s /codebase ' & $sDllPath & ' /regfile:"' & $sTempDllPath & '"', @ScriptDir, @SW_HIDE) = $DOTNET_REGASM_OK) Then Return SetError(5, 0, False) ; Unable to retrieve the GUID for registering as current user. EndIf Local Const $hFileOpen = FileOpen($sTempDllPath, BitOR($FO_READ, $FO_APPEND)) If $hFileOpen > -1 Then FileSetPos($hFileOpen, 0, $FILE_BEGIN) Local $sData = FileRead($hFileOpen) If @error Then $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] -= 1 ; Decrease the index due to failure. Return SetError(5, 0, False) ; Unable to retrieve the GUID for registering as current user. EndIf $sData = StringReplace($sData, 'HKEY_CLASSES_ROOT', 'HKEY_CURRENT_USER\Software\Classes') FileSetPos($hFileOpen, 0, $FILE_BEGIN) If Not FileWrite($hFileOpen, $sData) Then $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] -= 1 ; Decrease the index due to failure. Return SetError(5, 0, False) ; Unable to retrieve the GUID for registering as current user. EndIf FileClose($hFileOpen) Local $aSRE = StringRegExp($sData, '(?:\R@="{([[:xdigit:]\-]{36})}"\R)', $STR_REGEXPARRAYGLOBALMATCH) If @error Then $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] -= 1 ; Decrease the index due to failure. Return SetError(5, 0, False) ; Unable to retrieve the GUID for registering as current user. EndIf $aDllPaths[$iIndex][$DOTNET_PATHS_GUID] = $aSRE[0] ; GUID of the registry key. RunWait('reg import "' & $sTempDllPath & '"', @ScriptDir, @SW_HIDE) ; Import to current users' classes FileDelete($sTempDllPath) EndIf Else Return RunWait($sRegAsmPath & ' /codebase ' & $sDllPath, @ScriptDir, @SW_HIDE) = $DOTNET_REGASM_OK ; Register the .NET Dll. EndIf Case $DOTNET_UNLOADDLL For $i = $DOTNET_PATHS_MAX To $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] If $sDllPath = $aDllPaths[$i][$DOTNET_PATHS_FILEPATH] And Not ($aDllPaths[$i][$DOTNET_PATHS_FILEPATH] == Null) Then Return __DotNet_Unregister($sRegAsmPath, $aDllPaths[$i][$DOTNET_PATHS_FILEPATH], $aDllPaths[$iIndex][$DOTNET_PATHS_GUID]) EndIf Next Case $DOTNET_UNLOADDLLALL Local $iCount = 0 If $sDllPath == Null And $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] > 0 Then For $i = $DOTNET_PATHS_MAX To $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] If Not ($aDllPaths[$i][$DOTNET_PATHS_FILEPATH] == Null) Then $iCount += (__DotNet_Unregister($sRegAsmPath, $aDllPaths[$i][$DOTNET_PATHS_FILEPATH], $aDllPaths[$iIndex][$DOTNET_PATHS_GUID]) ? 1 : 0) EndIf Next $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] = 0 ; Reset the count. Return $iCount == $aDllPaths[$DOTNET_PATHS_INDEX][$DOTNET_PATHS_FILEPATH] EndIf EndSwitch Return True EndFunc ;==>__DotNet_Wrapper Func __DotNet_Unregister($sRegAsmPath, ByRef $sDllPath, ByRef $sGUID) Local $bReturn = RunWait($sRegAsmPath & ' /unregister ' & $sDllPath, @ScriptDir, @SW_HIDE) = $DOTNET_REGASM_OK ; Unregister the .NET Dll. If $bReturn Then If Not ($sGUID == Null) Then RegDelete('HKEY_CURRENT_USER\Software\Classes\CLSID\' & $sGUID) ; 32-bit path. RegDelete('HKEY_CLASSES_ROOT\Wow6432Node\CLSID\' & $sGUID) ; 64-bit path. $sGUID = Null ; Remove item. EndIf $sDllPath = Null ; Remove item. EndIf Return $bReturn EndFunc ;==>__DotNet_UnregisterI look forward to the comments and questions people have on this interesting subject, as well as any suggestions of improvement people might have. The ZIP file contains all related source code for both AutoIt and .NET. Dot-NET Assembly in AutoIt.zip1 point
-
mmm win95 ... you're sure you didn't use some 15x3.5 inch floppies labeled Window 3.11 to install that computer? Jos1 point
-
Distinguish between USB Fixed Disk and an External HDD.
meoit reacted to ViciousXUSMC for a topic
I see now your trying to determine between two fixed disk, I thought you just needed to know witch was the removable one. To the computer a USB HDD fixed type and a USB Flash Device fixed type are exactly the same. There is no difference. So you need to search for something that is different. Be that partition size, volume name, etc. You may need to manually create the environment that offers the variables you need, say putting a simple .txt file in the root that is called "ExternalHDD.txt" then use simple .bat file setup for Dir / Find or AutoIT for FileList / StringinStr Many ways to create your own variables to make this work.1 point -
Distinguish between USB Fixed Disk and an External HDD.
meoit reacted to ViciousXUSMC for a topic
WMI - Win32_LogicalDisks Drive Types: 2 = "Removable disk" 3="Fixed local disk" 4="Network disk" 5 = "Compact disk" Turn the WMI quiery into a Autoit script You can prune this down as needed. $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF $Output = $Output & "==========================================" & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $Output = $Output & "Access: " & $objItem.Access & @CRLF $Output = $Output & "Availability: " & $objItem.Availability & @CRLF $Output = $Output & "BlockSize: " & $objItem.BlockSize & @CRLF $Output = $Output & "Caption: " & $objItem.Caption & @CRLF $Output = $Output & "Compressed: " & $objItem.Compressed & @CRLF $Output = $Output & "ConfigManagerErrorCode: " & $objItem.ConfigManagerErrorCode & @CRLF $Output = $Output & "ConfigManagerUserConfig: " & $objItem.ConfigManagerUserConfig & @CRLF $Output = $Output & "CreationClassName: " & $objItem.CreationClassName & @CRLF $Output = $Output & "Description: " & $objItem.Description & @CRLF $Output = $Output & "DeviceID: " & $objItem.DeviceID & @CRLF $Output = $Output & "DriveType: " & $objItem.DriveType & @CRLF $Output = $Output & "ErrorCleared: " & $objItem.ErrorCleared & @CRLF $Output = $Output & "ErrorDescription: " & $objItem.ErrorDescription & @CRLF $Output = $Output & "ErrorMethodology: " & $objItem.ErrorMethodology & @CRLF $Output = $Output & "FileSystem: " & $objItem.FileSystem & @CRLF $Output = $Output & "FreeSpace: " & $objItem.FreeSpace & @CRLF $Output = $Output & "InstallDate: " & WMIDateStringToDate($objItem.InstallDate) & @CRLF $Output = $Output & "LastErrorCode: " & $objItem.LastErrorCode & @CRLF $Output = $Output & "MaximumComponentLength: " & $objItem.MaximumComponentLength & @CRLF $Output = $Output & "MediaType: " & $objItem.MediaType & @CRLF $Output = $Output & "Name: " & $objItem.Name & @CRLF $Output = $Output & "NumberOfBlocks: " & $objItem.NumberOfBlocks & @CRLF $Output = $Output & "PNPDeviceID: " & $objItem.PNPDeviceID & @CRLF $strPowerManagementCapabilities = $objItem.PowerManagementCapabilities(0) $Output = $Output & "PowerManagementCapabilities: " & $strPowerManagementCapabilities & @CRLF $Output = $Output & "PowerManagementSupported: " & $objItem.PowerManagementSupported & @CRLF $Output = $Output & "ProviderName: " & $objItem.ProviderName & @CRLF $Output = $Output & "Purpose: " & $objItem.Purpose & @CRLF $Output = $Output & "QuotasDisabled: " & $objItem.QuotasDisabled & @CRLF $Output = $Output & "QuotasIncomplete: " & $objItem.QuotasIncomplete & @CRLF $Output = $Output & "QuotasRebuilding: " & $objItem.QuotasRebuilding & @CRLF $Output = $Output & "Size: " & $objItem.Size & @CRLF $Output = $Output & "Status: " & $objItem.Status & @CRLF $Output = $Output & "StatusInfo: " & $objItem.StatusInfo & @CRLF $Output = $Output & "SupportsDiskQuotas: " & $objItem.SupportsDiskQuotas & @CRLF $Output = $Output & "SupportsFileBasedCompression: " & $objItem.SupportsFileBasedCompression & @CRLF $Output = $Output & "SystemCreationClassName: " & $objItem.SystemCreationClassName & @CRLF $Output = $Output & "SystemName: " & $objItem.SystemName & @CRLF $Output = $Output & "VolumeDirty: " & $objItem.VolumeDirty & @CRLF $Output = $Output & "VolumeName: " & $objItem.VolumeName & @CRLF $Output = $Output & "VolumeSerialNumber: " & $objItem.VolumeSerialNumber & @CRLF if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop $Output="" Next Else Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_LogicalDisk" ) Endif Func WMIDateStringToDate($dtmDate) Return (StringMid($dtmDate, 5, 2) & "/" & _ StringMid($dtmDate, 7, 2) & "/" & StringLeft($dtmDate, 4) _ & " " & StringMid($dtmDate, 9, 2) & ":" & StringMid($dtmDate, 11, 2) & ":" & StringMid($dtmDate,13, 2)) EndFunc1 point -
Winkill
Sanchopanza888 reacted to Jefrey for a topic
Take a look on the WinTitleMatchMode option. I think that's what you're looking for. Usage: Opt("WinTitleMatchMode", $iMode) ; or (alias): AutoItSetOption("WinTitleMatchMode", $iMode) Where $iMode is: 1 = (default) Match the title from the start (my notes: this is why you had to put the exact begining of the window name) 2 = Match any substring in the title (perhaps this is not what you want? or even a case insensitive one: -2) 3 = Exact title match 4 = Advanced mode (retained for backwards compatibility only - see Window Titles & Text (Advanced)) -1 to -4 = Case insensitive match according to the other type of match.1 point -
Winkill
Sanchopanza888 reacted to 232showtime for a topic
try? WinKill("[Class:XLMAIN]", "15_05_2017")1 point -
It depends on your function, but basically 0 = False, 1 = True you could also define it like so _On_Click(False) Func _On_Click($bDo = True) If $bDo Then MsgBox(0,'', "$bDo = " & $bDo) EndFunc1 point
-
Command line
antonioj84 reacted to Subz for a topic
You mean like this: Local $OracleRetail = FileGetShortName (@DesktopDir & "\POS Client Installer.exe") Local $Pinpad = RunWait(@ComSpec & ' /c "' & @DesktopDir & '\Personalize.cmd"')1 point -
meoit, Use RunWait as debug RunWait(@ComSpec & ' /K DiskPart /s "' & $DP_File & '"', '', @SW_SHOW)1 point
-
Winkill
Sanchopanza888 reacted to JLogan3o13 for a topic
Take a look at ProcessClose in the help file, you can kill the process rather than closing the window (assuming you don't have multiple Excel files open).1 point -
#include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> Local $aArray = DriveGetDrive($DT_ALL) Local $Return If @error Then ; An error occurred when retrieving the drives. MsgBox($MB_SYSTEMMODAL, "", "It appears an error occurred.") Else For $i = 1 To $aArray[0] $iBus1 = _WinAPI_GetDriveBusType($aArray[$i]) $iBus2 = DriveGetType($aArray[$i], 3) $iBus3 = DriveGetType($aArray[$i]) $Return &= @CRLF & StringUpper($aArray[$i]) & ' - ' & $iBus3 & @CRLF & " type : " & $iBus2 & @CRLF & " # " & $iBus1 & @CRLF Next EndIf ;~ ClipPut($Return) MsgBox(0, '', $Return) if you can't differentiate anything from this you can try this UDF1 point
-
This is great - It's cool to see someone else interested in AS400 automation! A few years ago I developed an application for my employer that automated iSeries and wrote a massive library to operate on these PCOMM classes. I found that using the AutScreenDesc class was a very reliable way of waiting for a screen by first describing it then calling the WaitForScreen() method. Alternatively, the WaitForString() and WaitForStringInRect() methods work just as well. I also found the SetConnectionByHandle() method was a bit more reliable when dealing with multiple sessions. I wish I could share the lib, but unfortunately it technically doesn't belong to me Though IBM provides a wealth of knowledge on these classes here and even provide VB example code which makes it super easy to translate into AU3.1 point
-
meoit, You are saying that when you compiled your script for 64bit and its stopped working even for the 32bit what did you use before when it was good and working ? what other changes have you made ? I have a similar problem with copy_dll_64 for a 64bit compile and I get that same error you could try commenting out Copy_Copy() commands just to see if your script will survive without those lines1 point
-
Your code is very unclear .... I mean unreadable maybe because you forget to read this: * How to post code on the forum * btw. Welcome to the forum.1 point
-
I researched a bit and have now a solution. By using this lines I can register dll without being an admin: RunWait($sRegAsmPath & ' /codebase ' & $sDllPath & ' /regfile:' & $sDllPath & '.reg', @ScriptDir, @SW_HIDE) ; Register the .NET Dll. _ReplaceStringInFile($sDllPath & '.reg', 'HKEY_CLASSES_ROOT', 'HKEY_CURRENT_USER\Software\Classes') RunWait('reg import ' & $sDllPath & '.reg', @ScriptDir, @SW_HIDE) ; Import to current users classes1 point
-
Wow, I haven't expected that this thread will be resurrected So, what it basically does is: 1. It checks registry entry for install path, if it doesn't find one it asks the user to select a folder. Then it verifies if the selected folder contains "game.exe" and "SetupTool.ini". 2. Then it collects video settings through the GUI, makes required "SetupTool.ini" with this config, replaces it in the game directory and starts the game. 3. Mouse setting has 2 characteristics $resp and $int. $resp is the maximum number of milliseconds after the last mouse movement to stop the mouse (mouse inertion simulation) $int is the intensity of movement. It's a minimum number of pixels covered by mouse to count as a movement. Something like "simulated mouse" sensitivity. Each mouse movement is compared with the previous one, and, according to this, specific keys are send to translate mouse movement to keyboard. For example, if mouse moved up and left (for more then 8 pixels by default) we press UP+LEFT and hold it (and/or change the direction) until mouse stops it's movement for more then 16 milliseconds. Additionally, some keys are blocked if others are used. Thats it. Hope it's easy to understand1 point