
bdwilcox
Members-
Posts
12 -
Joined
-
Last visited
bdwilcox's Achievements

Seeker (1/7)
0
Reputation
-
RunAs refuses to start OpenVPN GUI
bdwilcox replied to bdwilcox's topic in AutoIt General Help and Support
Nevermind, I just used RunAsTool -
RunAs refuses to start OpenVPN GUI
bdwilcox replied to bdwilcox's topic in AutoIt General Help and Support
Anyone have any ideas why the RunAs isn't working? -
RunAs refuses to start OpenVPN GUI
bdwilcox replied to bdwilcox's topic in AutoIt General Help and Support
Though both scripts you provided successfully start the OpenVPN GUI, they defeat the purpose as both demand Admin credentials in order to run. Instead, I was hoping to embed the Admin's credentials within the compiled executable by using the RunAs command. This way, users wouldn't need to feed the OpenVPN GUI the Admin credentials it requires to run instead relying on the credentials already within the AutoIt compiled EXE. -
The OpenVPN GUI needs to be run as an Admin but our users run as straight up users. I tried to use AutoIt to run the OpenVPN GUI as Administrator using the following script: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_Compile_Both=y #AutoIt3Wrapper_UseX64=y ;#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here RunAs("administrator", @ComputerName, "blah.blah.password", 0, '"C:\Program Files\OpenVPN\bin\openvpn-gui.exe"') Unfortunately, I run this and it doesn't do anything (no error - it just flashes in the system tray and disappears). I replaced the program path in the command with '"C:\windows\notepad.exe"' and Notepad starts without issue so I'm not sure what's going on with it. To troubleshoot, I compiled the above script into both 32 and 64 bit executables and tried running them as the user as well as Administrator and it doesn't do anything. I also tried running the script under the Administrator account and same thing. I then ran the path in Windows' Run dialogue box and it started the executable no problem. Any ideas why this script won't kick off the openvpn-gui executable?
-
In HP driver installs I have the below window that lists all found printers. I want AutoIt to click on a line if it finds the correct MAC address and then click the Next button. User "orbs" graciously pointed me to the ControlListView command to do this but I have found the documentation on this command a bit lacking and need some clarification. In trying to experiment with the command, it seems like I almost need nested ControlListView commands to feed the result of the FindItem control to the Select control like so: ControlListView ( "HP Officejet Pro 8600", "", 2001, "Select", ControlListView ( "HP Officejet Pro 8600", "", 2001, "FindItem", "8851FB150E26",3)) Tried this in my script and it didn't work...and it crashed the HP installer. So... 1) What does the last field in FindItem declare as it isn't documented well? The documentation says SubItem, which the documentation also declares to be a column value, so does this allow you to tell the FindItem control to only look in a certain column in the table ? (In my above example I put a 3 as I want it to look in column 3, the MAC address column) 2) For the Select control it has two parameters called From and To; are these numerical markers for the table grid or are they text strings? How do I declare what item for the Select command to, er, select? Just a little lost on the syntax here as the documentation is a bit...vague.
-
OK, downloaded a number of MSI packagers like Advanced Installer, Smart Packager, AppDeploy Repackager and ORCA and this is way over my head. I don't even know where to start with these things. HP driver packages are byzantine enough and these packagers are asking all kinds of questions about what files are x86 and x64... The original HP installer is for both and I usually just let it determine what to install but these packagers seem to want to differentiate on the file level and quite frankly I have no idea what to feed them. On another note, looked at the ControlListView command and don't see a clear way to use it in my case. It's almost like I need nested ControlListView commands to feed the result of the FindItem control to the Select control like so: ControlListView ( "HP Officejet Pro 8600", "", 2001, "Select", ControlListView ( "HP Officejet Pro 8600", "", 2001, "FindItem", "8851FB150E26",3)) Tried this in my script and it didn't work...and it crashed the HP installer. I really found the documentation page for this command lacking. So: 1) What does the last field in FindItem declare as it isn't documented well? The documentation says SubItem, which the documentation also declares to be a column value, so does this allow you to tell the FindItem control to only look in a certain column in the table (Here i put a 3 as I want it to look in column 3, the MAC address column)? 2) For the Select control it has two parameters called From and To; are these numerical markers for the table grid or are they text strings? How do I declare what item for Select to, um, select? Just a little lost on the syntax here as the documentation is a bit...vague.
-
Finally, does anyone know how to click on text in a Window if it matches a text string I tell it beforehand in the script? The problem I'm facing: during an HP driver install, it lists all of the printers of that type it finds on the network. You are supposed to click the printer instance you want to install (which selects and highlights its line in the list) and then click the Next button, but since I'm not sure what printers it will list in what order, I want it to select the line if it finds a unique text string on that line (in this case, the printer's MAC address that I declare somewhere in the script). The bigger problem is that when I use the AutoIt Window Info program to examine that printer line, it doesn't see each printer line as a unique control but instead sees the entire list block of all found printers as one control; therefore I will need it to click on the unique text itself to select the line its on since Windows Info doesn't see it's line as a unique control with its own ID (screenshot attached). If that's not possible, is there any way to make the script pause, wait for the user to select the desired printer line and then hit the Next button before it continues?
-
To xcaliber13, thank you for the suggestion but understand that I've had bad experiences with scripts that depended on timed wait states in the past. I appreciate your attempt to help, though, so please don't be offended. I tried what you suggested and it worked but I'm always concerned that external forces can cause a script to fail and do whatever I can to harden the script. To JLogan3o13, I'm not sure how to do a custom silent install using the driver's MSI's. The setup needs to install not only the printer driver itself but also the software to go along with it (HP Scan, printer help file, IRIS OCR agent) while excluding other software from the default install (HP survey, driver update agent, etc.). Do you know how to customize and automate this for an HP driver package by using its MSI in a silent install? To ViciousXUSMC, thank you for the commands and syntax as those were the ones I needed. Here is the completed script for the HP OfficeJet 4630 driver OJ4630_198.exe pre-install that only installs the IRIS OCR agent and printer help file from the optional install components (in case it might help someone): ;Runs an executable by treating the script's directory as the root directory Run(@scriptdir & "\Resources\Programs\HP Drivers\OJ4630_198.exe","") WinWaitActive("HP Officejet 4630 series", "Your printer is prepared if it's turned on, ink is installed, and paper is loaded.") ControlClick("HP Officejet 4630 series","","[ID:1189]") WinWaitActive("HP Officejet 4630 series", "Get the software recommended by HP to complete your printing experience.") ControlClick("HP Officejet 4630 series","","[ID:1099]") ControlClick("HP Officejet 4630 series","","[ID:1100]") ControlClick("HP Officejet 4630 series","","[ID:1104]") ControlClick("HP Officejet 4630 series","","[ID:1103]") ControlClick("HP Officejet 4630 series","","[ID:1016]") WinWaitActive("HP Officejet 4630 series", "Please review the following installation agreements and settings.") ControlClick("HP Officejet 4630 series","","[ID:1112]") ControlClick("HP Officejet 4630 series","","[ID:1016]") WinWaitActive("HP Officejet 4630 series", "Connect later – Do not connect to the printer now. I will connect it later.") ControlClick("HP Officejet 4630 series","","[ID:11003]") ControlClick("HP Officejet 4630 series","","[ID:1]") WinWaitActive("HP Officejet 4630 series", "The software has been installed successfully. However, your new HP printer has not yet been connected to this computer.") ControlClick("HP Officejet 4630 series","","[ID:1]")
-
I am trying to automate a pre-install of the HP driver and software for the OfficeJet 4630 ( OJ4630_198.exe ) with a simple AutoIt script since HP doesn't offer a full-featured corporate install package. The script is quite simple and works until a point: Run("OJ4630_198.exe","") WinWaitActive("HP Officejet 4630 series") ControlClick("HP Officejet 4630 series","","[ID:1189]") WinWaitActive("HP Officejet 4630 series") ControlClick("HP Officejet 4630 series","","[ID:1099]") ControlClick("HP Officejet 4630 series","","[ID:1100]") ControlClick("HP Officejet 4630 series","","[ID:1104]") ControlClick("HP Officejet 4630 series","","[ID:1103]") ControlClick("HP Officejet 4630 series","","[ID:1016]") WinWaitActive("HP Officejet 4630 series") ControlClick("HP Officejet 4630 series","","[ID:1112]") ControlClick("HP Officejet 4630 series","","[ID:1016]") WinWaitActive("[TITLE:HP Officejet 4630 series; INSTANCE:2]", "") ControlClick("HP Officejet 4630 series","","[ID:11003]") ControlClick("HP Officejet 4630 series","","[ID:1]") WinWaitActive("HP Officejet 4630 series") ControlClick("HP Officejet 4630 series","","[ID:1]") After the line ControlClick("HP Officejet 4630 series","","[ID:1016]") the script would simply stop. After this line executes is when the driver and two software packages are actually installed causing the window to eventually close and reopen. Because of this, I kept checking the Windows ID tag to see if it changed and it only changed after the install of all three packages so I added an INSTANCE to the next ControlClick line and set the INSTANCE to 2. Still doesn't work. I then tried changing the INSTANCE from 1 to 5 and none of them worked. At this point, I'm not sure what's going on. Anyone know what's happening and how to fix it? ================================================================================================ As an aside, I'm pretty new to AutoIt and was wondering how to declare the current folder as the root in a command line much like one would use %~dp0 in a batch. I would like to place the script in a root folder and then place the driver file in the subfolder <folder that script is in>\resources\driver\hp\4630. In a batch, the command line would be: start "" /wait %~dp0resources\driver\hp\4630\OJ4630_198.exe What would be the AutoIt equivalent? ================================================================================================ Finally, in the forum's Example Scripts section I tried to post two scripts I had created and found useful but I couldn't post anything there. Is there a posting limit one must reach in order to post there? Thanks for any help! -bdwilcox