Jump to content

RunAs refuses to start OpenVPN GUI


Recommended Posts

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?

Edited by bdwilcox
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...