Jump to content
Sign in to follow this  
JATO

ShellExecute as Admin

Recommended Posts

Trying to automate a Database install. The MDB file fires off a VB macro that creates an ODBC connection. Problem is.. that normal users don't have Power User or Admin rights to create the ODBC connection.

How can I make AutoIt run the ShellExecute command as a Admin? I know RunAs works for EXEs... but not MDB files....right?

Otherwise I have to log the user off and log in as admin myself to install, which defeats the purpose of the AutoIt script.

Any assistance would be greatly appreciated.

Thanks

Share this post


Link to post
Share on other sites

DOHH! Didn't even think of THAT.. THANK YOU :">

found that MSAccess.exe supports /switches

"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "c:\database.mdb" /user _____ /pwd _____

OR, I could just use the RunAsSet command in AutoIt and use "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE" "c:\database.mdb"

Thanks a bunch for pointing out the 1 thing I overlooked.

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...