Jump to content

ViciousXUSMC

Active Members
  • Posts

    916
  • Joined

  • Last visited

  • Days Won

    2

ViciousXUSMC last won the day on November 30 2015

ViciousXUSMC had the most liked content!

1 Follower

Recent Profile Visitors

1,276 profile views

ViciousXUSMC's Achievements

  1. Sort of a Necro Post but on topic, seemed better to pick up here with half the answer instead of starting a new thread. I just built a new computer and it keeps constantly having text size issues, and it seems to be a Windows bug related to scaling. The fix is to change one and/or both of the settings the Scaling as mentioned in this thread, but definitly for sure I have to often search for "text size" and change this value to something other than 100%, and then change it back and it fixes all my issues. Since this is one of those random MS bugs that probably nobody will ever fix, trying to just create a script that can reset these settings for me and set it to a hotkey or something. So my question is, as I have searched and had no luck. What is the SystemParameter for the Font Size? I used to use something like a registry change compare program and find what keys get changed and do my scripts that way, but you guys seem to find much better ways to make these changes, especially the ones that need a specific "trigger" to refresh without a reboot. Though I would not be supprised if I needed to close and reopen explorer.exe or something as even when making the change in the GUI it appears like it does that briefly.
  2. Because when you run a command like MSIEXEC the next part of the script wont run until it returns. I just use .bat files for this stuff and only AutoIT for really advanced things, so from Autoit you could use ShellExecuteWait() or RunWait() so it waits for a return before proceeding. Even if something requires configuration, chances are those configs are saved to a file that you can copy post install, or parameters you can set during the install. Like I said 99% of the time a silent install is possible. For enterprise I use MSI files as much as possible, so I always extract the Adobe .exe's to a MSI file and then you can use the Adobe Customization Wizard to create a MST that has any features set you need and create a MST file. Here is the .bat I use for Adobe Reader, it allows techs to install it in one click easy and also how I call the install from SCCM. Then I can just also call the .BAT from Autoit or another .BAT file if some kind of sequence of events is needed. Also leaves me a nice paper trail to verify things down the road. pushd %~dp0 MKDIR C:\Automate\Logs Set Logfile="C:\Automate\Logs\AdobeReaderDC_Install.log Echo %time% %date% Batch Install Started by %username% >> %logfile% Echo %time% %date% Starting Install of Adobe Reader DC v21.7.20091.59174 >> %logfile% msiexec.exe /qn /i "AcroRead.msi" TRANSFORMS="Enterprise_Modifications.mst" /L*V C:\Automate\Logs\AdobeReaderDC_Install_MSI.log Echo %time% %date% Starting Install of Adobe Reader DC v21.7.20091.59174 Update Patch >> %logfile% msiexec.exe /p AcroRdrDCUpd2100720091.msp /qn /L*V C:\Automate\Logs\AdobeReaderDCPatch_Install_MSI.log Echo %time% %date% Completed Install of Adobe Reader DC v21.7.20091.59174 >> %logfile% popd
  3. BTW Adobe Reader always has a silent install. I just built one the other day for the newest version. If this is a learning journey I support you for trying to find solutions and learn, if its strictly for getting a task done and you want it as professional and seamless as possible, you will want to set this up as a zero touch silent install.
  4. Same as I posted except no need for RegEx just StringReplace will suffice. The main rule of RegEx is only use RegEx when its needed
  5. That almost definitely sounds like your script is getting ahead of itself and its catching it the 2nd time thru. You should be able to use control functions and not rely on coordinates to click, or at minimum purely keyboard commands. Using coordinates can lead to a point of failure when people have different scaling options set on the computer. Check your WinWait() and ensure that the text used can not match the pre-existing window.
  6. I am sure there is a way to do this with pure regex using StringRegExpReplace() however since the matches are simple enough my thought process is to use a function that contains all your corresponding matches and replacements in an array or map or something and just use StringReplace() Also you can try nesting functions. $sString = "+h!s is @ test" $sNewString = StringReplace(StringReplace(StringReplace($sString, "+", "t"), "!", "i"), "@", "a") MsgBox(0, "", $sNewString)
  7. A few things, always for automating an install have #RequireAdmin in the script, that should elevate everything and hopefully prevent any security popups after you kick it off. Second 99% of everything can be silently installed without automating the GUI, in 15 years of doing this I have had only 1 or 2 things that did not have some method to silent install, even if it was a method I had to create myself. Third for automating GUI's if you have to go that route I always place a WinActivate() before each step to ensure the windows is up and active. And the last time I had a GUI automation fail like this it was because my text was not specific enough to wait for the correct window, and it was matching the previous window thus proceeding ahead in the script. So, based on the above I think you should be able to install that file with MSIEXEC with the /qn flags to silently install, if you need to tweak specific parameters, you can probably edit the MSI file or create a MST file.
  8. Koda Form Designer makes it pretty easy to build basic GUI's I use it all the time. Nothing super pretty, but always pretty functional
  9. This is also my thinking, could just update the array element and then use the _FileWriteFromArray() also currently stringinstr() is not the function to use if he needs RegEx. However I thought if the file is large and its only like 3ish that needs to be read it could be pretty inefficient. The other bonus is he could write the new array to a totally different file and preserve the original as a backup of sorts.
  10. If its always line 3 you can just use the function to write to the line without any read first. You can also if you only need to check like 3 and not the whole file use FileReadLine() to read that specific line, and then write based on the results. Just a more streamlined way to do it if the conditions you need to check have more specific parameters.
  11. Use a function to do that with a return value so you can exit your loop as soon as the match is found and have it return the value you want as part of the function. Else put an ExitLoop as part of your If/then statement to at least save some loops when the first value is matched. #include <Array.au3> Global $aStateArray[4][2] = [["Alabama","AL"],["Arkansas","AR"],["Arizona","AZ"],["Alaska","AK"]] $vAbbreviations = "Alaska" Local $iIndex = _ArraySearch($aStateArray, $vAbbreviations) For $i = 0 to UBound($aStateArray, 2)-1 If $aStateArray[$iIndex][$i] = $vAbbreviations Then $iSubIndex = $i Next MsgBox(0, "Found",$aStateArray[$iIndex][1]) ;New Code MsgBox(0, "Found", AbrevLookup($vAbbreviations)) ;Functions Func AbrevLookup($sState) For $i = 0 to UBound($aStateArray) -1 If StringInStr($aStateArray[$i][0], $sState) Then Return $aStateArray[$i][1] Next EndFunc
  12. Most of the time if you look, the application will store this "license" somewhere and you can brute force it by editing a file, a registry key, something. Unless it has to reach out to the cloud, but even then usually there is a way to embed it during install so that at first launch it will reach out to do that. As far as your method, as mentioned Send is very crude and a last resort. Atleast look into ControlSend() or something. If you absolutely MUST activate it at first launch, well then perhaps dont give the users a shortcut to the application, but a shortcut to your application. Which then launched the native application and does the activation stuff, upon completion deletes the shortcut to the autoit script and then replaces it with a shortcut to the original application.
  13. Assuming you normally keep the Zoom window up when you use the feature you built the code for. You could just say "only do this if Zoom window is active" that way the spacebar would work normally in all other circumstances. If you keep the window hidden, you can then downgrade this to "does the process/window exist" Lastly you could just use a different key that is not normally very used like one of the F Keys.
  14. I had some kind of crazy Oracle installer that gave me a random box that would break automation. I handled it in a different way. Because I had no idea when it would pop up rather than being in sequence I simply had a AdlibRegister() function checking for that pop up window and if it came up, it would close it. Worked well for me.
  15. I have nothing I can use for testing right now, but I can say in the past I used PLINK for my Putty automation. If you use the AutoIT window info tool and you do not see any text listed, then you will not get anything from WinGetText() I want to say you can have Putty pretty much log everything to a log file as its running, and then you can read that file as a workaround.
×
×
  • Create New...