
AasimPathan
Active Members-
Posts
59 -
Joined
-
Last visited
Everything posted by AasimPathan
-
AutoIt HotKeySet StickyKeys - (Moved)
AasimPathan replied to AasimPathan's topic in AutoIt General Help and Support
Thank you this did the trick, works flawlessly. -
AutoIt HotKeySet StickyKeys - (Moved)
AasimPathan replied to AasimPathan's topic in AutoIt General Help and Support
Hi that kind of helps but I need to send things in RAW format cause one of of my shortcuts has a text to send which includes # so if use _SendEx("#[This is a test message]",1) it doesn't send the #, which is kind of important to us. Also, the below didn't help with getting the keys unstuck unless I am using it wrong ControlSend("", "", "", "text", 0) -
Hi, We have a AutoIt shortcut script with the CTRL+ALT+SHIFT Key as the hotkey with multiple shortcuts e.g. CTRL+ALT+SHIFT+r launches on of our programs. We have an issue where even though Sticky Keys is disabled in windows the CTRL+ALT+SHIFT are still being "stuck" or acting as if Sticky Key is enabled, I need to know if someone is facing similar problem and ways to avoid it because right now our users are facing problems typing anything after using a shortcut as the CTRL+ALT+SHIFT key is locked. Oh another note, we are using ConnectWise ScreenConnect for remoting in to the Windows 10 machine, Sticky Keys are disabled on both my local machine and the remote one where the shortcuts run. I can see the keys are being held down using on-screen Keyboard and to unstick them we have to press the same combination for a second time. Also this only happens when the AutoIt script is running, if its not running no matter how many times I press CTRL+ALT+SHIFT+r the keyboard doesn't get stuck/ held down. Remote Keyboard Local and Remote Keyboard Sticky Keys disabled
-
Well the end game was to Compile all AU3 scripts to EXE's so the ConsoleWrite command needs to be output to Powershell or CMD. Below code is what I came up with, Thanks to all of you who responded.But its still not complete. I now want to copy the Compiled files to a folder path and i am unable to get that to work. ;<Comment Type='LastReview' Contact='PathA00' Date='2019-05-01'\> ;This script will compile all AutoIt Sripts with extention .au3 in C:\U_C folder and copy them to A:\U_A\U_W\U_Dpts\U_IT\U_Soft ;#[8:HowRK00: Test with me this scrip is now complete] #include <AutoItConstants.au3> #include <Array.au3> #include <Crypt.au3> #include <File.au3> #include <FileConstants.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <WinAPIFiles.au3> #RequireAdmin Opt("MustDeclareVars", 1) #Region "Bayonet - Fields" Global $M_V_Scalar_Object_DebuggingModeIsOn = 1 Global $M_V_Scalar_Object_Powershell = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" Global $M_V_Scalar_Object_CodeRootDirectory = "C:\U_C\" Global $M_V_Scalar_Object_AutoItCompiledRootDirectory = "A:\U_A\U_W\U_Dpts\U_IT\U_Soft\" Global $M_V_Scalar_Object_Array = "" Global $M_V_Scalar_Object_ArrayToInteger = "" Run($M_V_Scalar_Object_Powershell, "C:\Program Files (x86)\AutoIt3\Aut2Exe") #EndRegion #Region "Bayonet - Methods" M_S_Main() Func M_S_Main() Local $L_V_Scalar_Object_SearchRootDirectory = StringLeft($M_V_Scalar_Object_CodeRootDirectory, StringInStr($M_V_Scalar_Object_CodeRootDirectory, "\", Default, -1)) If StringRight($L_V_Scalar_Object_SearchRootDirectory, 5) = "beta\" Then $L_V_Scalar_Object_SearchRootDirectory = StringTrimRight($L_V_Scalar_Object_SearchRootDirectory, 5) EndIf $M_V_Scalar_Object_Array = _FileListToArrayRec($L_V_Scalar_Object_SearchRootDirectory, "*.au3", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) If $M_V_Scalar_Object_DebuggingModeIsOn Then _ArrayDisplay($M_V_Scalar_Object_Array, "AutoIt Scripts") For $M_V_Scalar_Object_ArrayToInteger = 1 To $M_V_Scalar_Object_Array[0] ClipPut($M_V_Scalar_Object_Array[$M_V_Scalar_Object_ArrayToInteger]& @CRLF) Sleep(1000) WinActivate("Administrator: Windows PowerShell") Sleep(100) Send("attrib -r ") Send("^v") Sleep(100) Send("{ENTER}") Sleep(100) Send("{ENTER}") Sleep(100) Send(".\Aut2exe_x64.exe /in ") Sleep(100) Send("^v") Sleep(100) Send("{ENTER}") Sleep(2000) Send("attrib +r ", $SEND_RAW) Send("^v") Sleep(100) Send("{ENTER}") Sleep(2000) Next WinClose("Administrator: Windows PowerShell") M_S_ReleaseCompiledScripts() EndFunc Func M_S_ReleaseCompiledScripts() Local $L_V_Scalar_Object_SearchRootDirectory = StringLeft($M_V_Scalar_Object_CodeRootDirectory, StringInStr($M_V_Scalar_Object_CodeRootDirectory, "\", Default, -1)) If StringRight($L_V_Scalar_Object_SearchRootDirectory, 5) = "beta\" Then $L_V_Scalar_Object_SearchRootDirectory = StringTrimRight($L_V_Scalar_Object_SearchRootDirectory, 5) EndIf $M_V_Scalar_Object_Array = _FileListToArrayRec($L_V_Scalar_Object_SearchRootDirectory, "U_A_*.exe", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) If $M_V_Scalar_Object_DebuggingModeIsOn Then _ArrayDisplay($M_V_Scalar_Object_Array, "Executable Files") For $M_V_Scalar_Object_ArrayToInteger = 1 To $M_V_Scalar_Object_Array[0] FileCopy($M_V_Scalar_Object_Array[$M_V_Scalar_Object_ArrayToInteger], $M_V_Scalar_Object_AutoItCompiledRootDirectory, $FC_OVERWRITE, $FC_CREATEPATH) ;this is not working for me, any ideas? Next EndFunc #EndRegion
-
Can you help me differentiate between the two? Test() Func Test() $aArray = _FileListToArrayRec("your parameters here") For $aArray[0] To UBound($aArray) - 1 Next EndFunc Test() Func Test() Local $L_V_Scalar_Object_Array = _FileListToArrayRec($L_V_Scalar_Object_SearchRootDirectory, "*.au3", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) For $L_V_Scalar_Object_Array[0] To UBound($L_V_Scalar_Object_Array) -1 ;Run($M_V_Scalar_Object_CompileAu3ToExe & "/in" & $L_V_Scalar_Object_Array) Next EndFunc
-
This is as far as i got, didn't work #include <AutoItConstants.au3> #include <Array.au3> #include <Crypt.au3> #include <File.au3> #include <FileConstants.au3> #include <Misc.au3> #include <MsgBoxConstants.au3> #include <StringConstants.au3> #include <WinAPIFiles.au3> ;#RequireAdmin Opt("MustDeclareVars", 1) #Region "Fields" Global $M_V_Scalar_Object_DebuggingModeIsOn = 1 ;Global $M_V_Scalar_Object_Powershell = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" Global $M_V_Scalar_Object_AutoItCompilerPath = "C:\Program Files (x86)\AutoIt3\Aut2Exe" Global $M_V_Scalar_Object_CodeRootDirectory = "C:\U_C\" Global $M_V_Scalar_Object_AutoItCompiledRootDirectory = "A:\U_A\U_W\U_Dpts\U_IT\U_Soft" Global $M_V_Scalar_Object_CompileAu3ToExe = "C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2exe_x64.exe" #EndRegion #Region "Methods" M_S_Main() Func M_S_Main() Local $L_V_Scalar_Object_SearchRootDirectory = StringLeft($M_V_Scalar_Object_CodeRootDirectory, StringInStr($M_V_Scalar_Object_CodeRootDirectory, "\", Default, -1)) If StringRight($L_V_Scalar_Object_SearchRootDirectory, 5) = "beta\" Then $L_V_Scalar_Object_SearchRootDirectory = StringTrimRight($L_V_Scalar_Object_SearchRootDirectory, 5) EndIf Local $L_V_Scalar_Object_Array = _FileListToArrayRec($L_V_Scalar_Object_SearchRootDirectory, "*.au3", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_NOSORT, $FLTAR_FULLPATH) For $L_V_Scalar_Object_Array[0] To UBound($L_V_Scalar_Object_Array) -1 Run($M_V_Scalar_Object_CompileAu3ToExe & "/in" & $L_V_Scalar_Object_Array) Next EndFunc #EndRegion
-
Ok that worked, so now that i have the file list displayed how do I copy them to be placed in compile. Remember that his list will either increase or decrease over time. so it needs to work regardless of the number of Rows. Also I don't see the entire path here? it starts from the folder instead of C:\U_C\
-
Yeah that is what i tried as well but couldn't get it to work #include <Array.au3> #include <File.au3> #include <MsgBoxConstants.au3> Test() Func Test() Local $RootDirectory = "C:\U_C" Local $RootOfU_C = StringLeft($RootDirectory, StringInStr($RootDirectory, "\", Default, -1)) If StringRight($RootOfU_C, 5) = "beta\" Then $RootOfU_C = StringTrimRight($RootOfU_C, 5) EndIf ConsoleWrite($RootOfU_C & @CRLF) $aArray = _FileListToArrayRec($RootOfU_C, "*.au3", $FLTAR_FILES) _ArrayDisplay($aArray, ".AU3 Files") EndFunc The Output is C:\
-
Hi, I have multiple autoit scripts stored inside my C:\ I would like to create a script that finds all the *.au3 scripts inside C:\ and subfolders and then somehow compile them to .exe Can someone help me create such a script? one method i thought of doing was running Powershell Get-ChildItem -Recurse -ErrorAction SilentlyContinue -Path C:\U_C | Select-Object FullName | ft -AutoSize | out-string -Width 600 *> C:\U_A\U_W\C_NonFiledFiles\U_Temp\AllAutoItScriptPath.txt How do i make AutoIT read that file using FileOpen or FileRead or FileReadLine functions, when there maybe 1 line or more than 20 lines, currently there are 15 and some of them are blank spaces for some reason, so i need a way to tell autoit if the path in the text file ends in .au3 to only copy that line. Once that is done i think the next part is much simpler to just run the autoit command line interface C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2exe_x64.exe /in [Path of the script]
-
Get MSI Product Version and Install if newer
AasimPathan replied to AasimPathan's topic in AutoIt General Help and Support
Solved it.. Thanks. It was my mistake didn't past the Func() 😩 -
Get MSI Product Version and Install if newer
AasimPathan replied to AasimPathan's topic in AutoIt General Help and Support
#include <AutoItConstants.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <Array.au3> #include <Misc.au3> #include <Crypt.au3> #include <File.au3> #include <StringConstants.au3> Local $Username = "UsernameToEncrypt" Local $UsernameEncrypted = StringEncrypt(True, $Username, 'rando') MsgBox("", "", "ENCRYPTED USERNAME: " & $UsernameEncrypted & " DECRYPTED USERNAME: " & StringEncrypt(False, $UsernameEncrypted, 'rando')) Local $Password = "PasswordToEncrypt" Local $PasswordEncrypted = StringEncrypt(True, $Password, 'rando') MsgBox("", "", "ENCRYPTED Password: " & $PasswordEncrypted & " DECRYPTED Password: " & StringEncrypt(False, $PasswordEncrypted, 'rando')) The Above doesnot work as you provided the code in the above post. Error (12) : ==> Unknown function name.: Local $UsernameEncrypted = StringEncrypt(True, $Username, 'rando') Local $UsernameEncrypted = ^ ERROR -
Hi Bert, I seem to have spoken too soon. Today I deployed the schedule task that calls the other exe that should show up the message that system is restarting. But when I ran the scheduled task it didn't pop up the message neither. basically there are 2 EXE files The RestartScheduler calls the RestartCore which should display the popup notification, and when i run it manually it does and works as expected. But running the same in Task Scheduler, does not show any GUI. even though i can see it running in Task Manager, i even tried changing from SYSTEM to my Username and that didn't help either. I am adding the code here if someone can help me tweak this, I would appreciate it a lot. ;This script is necessary even though the only thing that it does is call another script because if the other script ran directly it would run under the user account and therefore the message would not appear on the logged-on user's screen. #include <AutoItConstants.au3> #include <Misc.au3> #NoTrayIcon M_S_RestartWindows() Func M_S_RestartWindows() Run("C:\Programs\U_A_A_WindowsRestartCore.exe") EndFunc #include <AutoItConstants.au3> #include <Misc.au3> #NoTrayIcon Local $sMessage = "This computer will restart in the next 2 minutes; save all open documents immediately!" SplashTextOn("Restart Computer", $sMessage, -1, -1, -1, -1, $DLG_TEXTLEFT, "", 24) Sleep(120000) ;120 seconds M_S_Restart() SplashOff() Func M_S_Restart() Shutdown(6) EndFunc
-
I've made the following change in the script which seems to have done the trick, but I would still like to see if we can get this to work without requiring admin permissions, rest of the script remains the same. #RequireAdmin Func TaskSchedulerOnLocalComputer() $LocalSCHTASKS = "schtasks /Run /TN GoogleUpdateTaskMachineCore" RunWait('"' & @ComSpec & '" /k ' & $LocalSCHTASKS, @SystemDir) Sleep(3000) WinClose("Administrator: C:\WINDOWS\system32\cmd.exe") EndFunc
-
No there no schedule point, the task should will run when triggered manually, irrespective of when the automatic triggered are configured. Let me explain. I have been working on this project for my client, who runs a dev project which has some office addins to be deployed to local computers. I with the help of some forum members here created an autoit script that checks if a folder contains an msi file, checks its version, if its newer than the installed version it will upgrade, if its older it will upgrade, if its the same it will exit. This will be added to each computers as a scheduled task to run atleast once per day and triggered manually as well. The script i am creating above is to call that scheduled task manually for the dev team to force push the installs on computers immediately instead of once per day. e.g. lets say users are facing a problem and cannot work in Office Apps due to the Addin, dev team can resolve the issue & force push the package. In the script i posted in the first page, I am just using the default task that i know exists on all computers that has Google Chrome installed so basically this can be used on any computer, and the script just works fine for all of the 9/10 computers in that list except for the local computer. Regardless of what that computer is the script just doesn't want to run on a local pc. e.g. if I call the script from Computer1, to check if Computer2 is online - it runs, says "Computer2 is online" and then opens CMD prompt and starts the task. I can confirm that it works because i can login on Computer2 and see that the task was triggered in its history. But If I call Computer1, it says Computer1 is online but doesn't run the script even when using RunAs() administrator.
-
Sorry @Deye I didnot understand that, Task is already there and created, and it also runs when the user executes it. it doesn't work through SCHTASKS.EXE though, but when i run cmd as admin and then run SCHTASKS it works fine. so I need AutoIT to run elevated cmd which its not doing for me as it doesn't show me the cmd window when using RunAs
-
Hi, So I am creating another project here 😵 this would be my I guess 4th / 5th AutoIT project and I am trying to get better at this, and still learning. The below script I am creating does 2 things, from the list of computers, If we select the checkbox shows whether the PC is online & if that PC is online, run a pre-configured scheduled task. And this script works like 90% everything is functional. the area i am getting stuck with is the TaskSchedulerOnLocalComputer() Basically I having problems running the task on local computer, even though I have full admin access on my PC and I can right click & Start the Task from Task Scheduler, when i run the script, for every other computer i get SUCCESS: Attempted to run the scheduled task "GoogleUpdateTaskMachineCore". and it works but when I run the same on my local PC (by selecting it from the list) I get Access Denied So I tried to use RunAs but that doesn't display any window or anything and also doesn't run the task, So if someone can help me get this working for local computer that would be great. Thanks ;Script to Push the installation of MatrixCodeBase ;Reference: https://docs.microsoft.com/en-us/windows/desktop/taskschd/schtasks #include <AutoItConstants.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <GUIConstantsEx.au3> #include <GUIConstants.au3> SelectComputer() Func CheckIfComputerIsOnline() If RunWait("ping.exe -n 1 " & $ComputerName, "", @SW_HIDE) == 0 Then MsgBox(0, "", $ComputerName & " is Online") RunScheduledTask($ComputerName) Else MsgBox(0, "", $ComputerName & " is Offline") Send("{SPACE}") EndIf EndFunc Func SelectComputer() Local $hGUI = GUICreate("Select Computer", 300, 300) Opt("GUICoordMode", 0) ;1=absolute, 0=relative, 2=cell Local $idCheckbox1 = GUICtrlCreateCheckbox("Computer1", 10, 10) Local $idCheckbox2 = GUICtrlCreateCheckbox("Computer2", -1, 25) Local $idCheckbox3 = GUICtrlCreateCheckbox("Computer3", -1, 25) Local $idCheckbox4 = GUICtrlCreateCheckbox("Computer4", -1, 25) Local $idCheckbox5 = GUICtrlCreateCheckbox("Computer5", -1, 25) Local $idCheckbox6 = GUICtrlCreateCheckbox("Computer6", -1, 25) Local $idCheckbox7 = GUICtrlCreateCheckbox("Computer7", -1, 25) Local $idCheckbox8 = GUICtrlCreateCheckbox("Computer8", -1, 25) Local $idCheckbox9 = GUICtrlCreateCheckbox("Computer9", -1, 25) Local $idCheckbox10 = GUICtrlCreateCheckbox("Computer10", -1, 25) Local $idButton_Insert = GUICtrlCreateButton("Done", 150, 10) Local $idButton_Close = GUICtrlCreateButton("Close", 50, 0) GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idButton_Close ExitLoop Case $idCheckbox1 Global $ComputerName = "Computer1" If _IsChecked($idCheckbox1) Then CheckIfComputerIsOnline() Else _IsUnchecked($idCheckbox1) EndIf Case $idCheckbox2 Global $ComputerName = "Computer2" If _IsChecked($idCheckbox2) Then CheckIfComputerIsOnline() Else _IsUnchecked($idCheckbox2) EndIf Case $idCheckbox3 Global $ComputerName = "Computer3" If _IsChecked($idCheckbox3) Then CheckIfComputerIsOnline() Else _IsUnchecked($idCheckbox3) EndIf Case $idCheckbox4 Global $ComputerName = "Computer4" If _IsChecked($idCheckbox4) Then CheckIfComputerIsOnline() Else _IsUnchecked($idCheckbox4) EndIf Case $idCheckbox5 Global $ComputerName = "Computer5" If _IsChecked($idCheckbox5) Then CheckIfComputerIsOnline() Else _IsUnchecked($idCheckbox5) EndIf Case $idCheckbox6 Global $ComputerName = "Computer6" If _IsChecked($idCheckbox6) Then CheckIfComputerIsOnline() Else _IsUnchecked($idCheckbox6) EndIf Case $idCheckbox7 Global $ComputerName = "Computer7" If _IsChecked($idCheckbox7) Then CheckIfComputerIsOnline() Else _IsUnchecked($idCheckbox7) EndIf Case $idCheckbox8 Global $ComputerName = "Computer8" If _IsChecked($idCheckbox8) Then CheckIfComputerIsOnline() Else _IsUnchecked($idCheckbox8) EndIf Case $idCheckbox9 Global $ComputerName = "Computer9" If _IsChecked($idCheckbox9) Then CheckIfComputerIsOnline() Else _IsUnchecked($idCheckbox9) EndIf Case $idCheckbox10 Global $ComputerName = "Computer10" If _IsChecked($idCheckbox10) Then CheckIfComputerIsOnline() Else _IsUnchecked($idCheckbox10) EndIf EndSwitch WEnd GUIDelete($hGUI) EndFunc Func _IsChecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc Func _IsUnchecked($idControlID) Return BitAND(GUICtrlRead($idControlID), $GUI_UNCHECKED) = $GUI_UNCHECKED EndFunc Func RunScheduledTask($ComputerName) If @ComputerName = $ComputerName Then TaskSchedulerOnLocalComputer() Else TaskSchedulerOnRemoteComputer() EndIf EndFunc Func TaskSchedulerOnLocalComputer() $sUser = "username" $sPass = "password" $sDomain = "domain" $LocalSCHTASKS = "schtasks /Run /TN GoogleUpdateTaskMachineCore" RunAs($sUser,$sDomain, $sPass,0, @ComSpec & '" /k ' & $LocalSCHTASKS, @SystemDir) Sleep(3000) Send("Exit") Send ("{Enter}") EndFunc Func TaskSchedulerOnRemoteComputer() $RemoteSCHTASKS = "schtasks /U username /p password /Run /TN GoogleUpdateTaskMachineCore /S " & $ComputerName RunWait('"' & @ComSpec & '" /k ' & $RemoteSCHTASKS, @SystemDir) Sleep(3000) Send("Exit") Send ("{Enter}") EndFunc
-
Get MSI Product Version and Install if newer
AasimPathan replied to AasimPathan's topic in AutoIt General Help and Support
Hi, Well I got it work but i'll paste the script here just in case you want to see if i might get any issues. #include <AutoItConstants.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <Array.au3> #include <Misc.au3> #include <File.au3> #include <StringConstants.au3> ;Minimum required version of the Matrix Code Base is 1.0.3.0 ;This script will not function if the version is lower than the above Global $Username = "ServerAdmin" Global $Password = "PasswordInPlain" ;I am trying to see if we can encypt this and any passwords we use in AutoIt but for now its set as plain text Global $Domain = "Domain" ;The above login is required to execute the installer, if the credentials are not provided then the installer will prompt each user to enter a username & password and therefore fail to install since standard users do not have any rights to install a software Global $MSIPath = "A:\SomePath\SomeFolder\SomeSubFolder\MatrixCodeBase.msi" ; MSI Package path Global $GetMSIVersion = QueryMSIPackage($MSIPath,'ProductVersion') ; get the version info of the msi installer Global $GetInstalledVersion = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{8B3DFDFF-D894-4A31-AA92-824729385F15}", "DisplayVersion") ; get the version info of the installed software. While 1 Sleep(25) If $GetInstalledVersion = @error Then InstallMatrixCodeBase() ElseIf $GetMSIVersion = $GetInstalledVersion Then Exit ElseIf $GetMSIVersion <> $GetInstalledVersion Then InstallMatrixCodeBase() EndIf ExitLoop WEnd Func CloseRunningOfficePrograms() ;Closes all Running Microsoft Office Programs If ProcessExists("EXCEL.EXE") Then ProcessClose("EXCEL.EXE") If ProcessExists("OUTLOOK.EXE") Then ProcessClose("OUTLOOK.EXE") If ProcessExists("POWERPNT.EXE") Then ProcessClose("POWERPNT.EXE") If ProcessExists("VISIO.EXE") Then ProcessClose("VISIO.EXE") If ProcessExists("WINWORD.EXE") Then ProcessClose("WINWORD.EXE" InstallMatrixCodeBase() EndFunc Func InstallMatrixCodeBase() ;Install Matrix Code Base FileCopy("A:\SomePath\SomeFolder\SomeSubFolder\MatrixCodeBase.msi", "C:\Install") RunAsWait($user, $domain, $pass, 0, "msiexec /i C:\Install\MatrixCodeBase.msi /passive") EndFunc Func QueryMSIPackage($sMSI, $PropertyName) ; Query the MSI installer to get installer properties If FileExists($MSIPath) And $PropertyName <> '' Then Local $Query = "SELECT Value FROM Property WHERE Property = '" & $PropertyName & "'" $oInstaller = ObjCreate("WindowsInstaller.Installer") $oDB = $oInstaller.OpenDataBase($sMSI, 0) $oView = $oDB.OpenView($Query) $oView.Execute() $oRecords = $oView.Fetch $oPropValue = $oRecords.StringData(1) If $oPropValue <> "" Then Return $oPropValue EndIf EndIf Return "" EndFunc Func _ComError($oMyError) ;COM Error function defined in COM Error Handler used in COM functions. MsgBox(16, "AutoItCOM ERROR!", "COM Error Intercepted!" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & Hex($oMyError.number, 8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) EndFunc -
Get MSI Product Version and Install if newer
AasimPathan replied to AasimPathan's topic in AutoIt General Help and Support
Can you write that in code please? as i don't know how to do that part well. I am more of a IT admin rather than a scripter/coder.