Jump to content
Sign in to follow this  
MrDowntown

Run Quark as administrator

Recommended Posts

MrDowntown

Sorry to be posting regarding this topic yet again, but I've searched the forum, looked at samples and still I'm hitting a brick wall. I'm running QuarkXpress 8 on a couple of desktops and the program won't run unless I'm either logged in as administrator or right click the shortcut and choose Run As Administrator. Without administrative rights, I get a error of File Not Found [-43].

Here's the script I've tried based on samples I've found, but either I get the same File Not Found error or I immediately get Error: Incorrect number of parameters in function call.

; Fill in the username and password appropriate for your system.

Local $sUserName = "administrator"

Local $sDomain = "XYZ.lan"

Local $sPassword = "blahblah"

RunAs($sUserName, $sDomain, $sPassword)

Run("c:\program files\quark\quarkxpress 8\quarkxpress.exe")

I recall being able to get this to work in the past on a system at work for a program that required administrative rights. I believe that was AutoIt V2x, using RunAsSet on XP. I also tried to modify that script, which was successful, (replacing RunAsSet, which I believe is gone) and was unsuccessful.

Thanks for any suggestions. I really don't wish to give a user admin rights just to run Quark.

Share this post


Link to post
Share on other sites
mihaibr

The RunAs function looks like this:

RunAs ( "username", "domain", "password", logon_flag, "program" [, "workingdir" [, show_flag [, opt_flag]]] )

you should use it like this:

RunAs($sUserName, $sDomain, $sPassword, 0,"c:program filesquarkquarkxpress 8quarkxpress.exe")

but replace 0 with what logon_flag you need to use from here

Edited by mihaibr

Share this post


Link to post
Share on other sites
Country73

You could also simply put in - #RequireAdmin - at the top of your script before compiling.

When the program is launched, if they are not a local admin on the workstation it will bring up the "RunAs" to supply credentials.


If you try to fail and succeed which have you done?AutoIt Forum Search

Share this post


Link to post
Share on other sites
elongp

I have a similar problem running a SumTotal Pathlore application that has several switches after the exe that require quotes in specific locations. This application must run in admin mode, and we do not make our users local admins for something like this. I'd rather they not have to type in the local account and password each time, so I wanted to create a script to do that for them. This is the command line directly from the shortcut:

"C:\Program Files\Pathlore\Tools\psbMailCreate.exe" /R:Oracle /F:"SVDR" /U:pathlore_data

It's calling data from an Oracle database. It's the quotes around the "SVDR" that are giving the script problems. The application can't connect to ODBC if you don't have the quotes, and I can't get the script to compile if the quotes are there. Any suggestions?

I can shift-right click and run as different user with my support account, but most users of this application are not in support. I saw the #RequireAdmin to put in the script, and again I'm trying to bypass a login if possible.

Thanks!

E Powell

Austin, TX

Share this post


Link to post
Share on other sites
JLogan3o13

Hi, elongp. Have you looked into using something like psexec to run the install under the System context? You could use psexec with your script to run the install remotely, just calling it with the right switches at run time. You could even delete it at the end of the script if you'd like to do some "cleanup".

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
elongp

I have not. Will check it out. It's not actually an installation, it's the executable for the application.

Share this post


Link to post
Share on other sites
RocTx

This one runs quite well for me.

OS = Windows 7 Enterprise

; Fill in the username and password appropriate for your system.
Local $sUserName = "Administrator"
Local $sPassword = "PassWord"
; Run a command prompt as the other user.
Local $pid = RunAsWait($sUserName, @ComputerName, $sPassword, 0, "dfrgui.exe", @SystemDir)
; Wait for the process to close.
ProcessWaitClose($pid)

Came right out of the Example code in the help file.

RocTx

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  

×