AutoHotkey Community

It is currently May 27th, 2012, 11:55 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: November 10th, 2005, 11:51 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
I'm needing serious help here. :?

I have the following script:

RunAs, AdminUser, AdminPass, domain
runwait, RAdmin.msi


When this script is executed on a PC in the domain with restricted user privileges. I receive the following error:

Error: Launch Error (possibly related to RunAs)

If I remove the RunAs command and then just execute the single line of script as follows:

runwait, RAdmin.msi

Then the MSI package will start (of course, it won't install because of restricted rights).

Can anyone tell me what the HECK I'm doing wrong? :x


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2005, 9:39 am 
Offline

Joined: October 23rd, 2005, 9:14 pm
Posts: 18
Location: Germany, Stuttgart
Hi,

have you seen my post about an similar runas problem?
http://www.autohotkey.com/forum/viewtopic.php?t=6206

I think, runas does not work as expected.

My current Workaround is:

Code:
; simple Runas workaround, km, 11/05
; add your Username and PW

SetTitleMatchMode, 2
SetTitleMatchMode, slow

Run, runas /profile /user:AdminUser explorer.exe, , UseErrorLevel
if ErrorLevel <> 0
{
    MsgBox, 48, Error, Program "runas.exe" not found!
    ExitApp
}

;following code only to sending pw, pw not encrypted!
;you could remove this part
WinWaitActive, runas.exe, , 5
if ErrorLevel <> 0
{
    MsgBox, 48, Error, Could not start "runas.exe"!
    ExitApp
}

IfWinActive, runas.exe
{
    Send AdminPw{ENTER}      ;pw is not encrypted! Everyone could read this script....
}
else
{
    MsgBox, 48, Error, Could not start "runas.exe"!
    ExitApp
}
ExitApp


Does this help?

_________________
regards km


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2005, 6:17 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
Thanks KM for the info, but ... it didn't work :?

the RUNAS command is only for EXEs. I thought I would try your script anyways... just to be sure and this is the result I get:

RUNAS ERROR: Unable to run - programname.msi
193: programname.msi is not a valid Win32 application.

I'm getting desperate now :(

I need to make this work as I have about 15 MSIs I need to distribute in a network roll-out and none of the users have admin privs on their PCs


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2005, 6:36 pm 
Offline

Joined: December 15th, 2004, 10:24 pm
Posts: 303
Location: United States
From the helpfile, just to be sure:
Quote:
RunAs: Domain: User's domain. To use a local account, leave this blank. If that fails to work, try using @YourComputerName.

#EscapeChar (and explanation of escape sequences) in case you have special characters in your password.

_________________
1) The Open Source Definition http://www.opensource.org/docs/definition_plain.php

2) Intuitive. Logical. Versatile. Adaptable. <<AutoHotkey>>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2005, 7:59 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
Decarlo110,
I'm not sure where you're going with your post. But let me see if this is what you are thinking:

The PCs in question belong to, let say, domain XYZ.
the domain admins account is installed on the PCs, but users are authenticating with user privileges. This prevents them from installing software (I'm sure you know this).

I'm logging in with the following account:
UserXXX
this user is a member of the Domain Admins group

in my AHK script, I have:

RunAs, UserXXX, SimplePsWd, XYZ


ESC characters are not required because the password is simple


The installation files are copied locally to the PCs in question and executed (supposed to be anyways).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2005, 8:16 pm 
Offline

Joined: October 23rd, 2005, 9:14 pm
Posts: 18
Location: Germany, Stuttgart
Bartimus wrote:
the RUNAS command is only for EXEs.


Hm, could you try this:

Code:
Run, runas /profile /user:AdminUser "C:\WINNT\system32\msiexec.exe /i  addyour.msi", , UseErrorLevel


Maybe this works because now it's an exe! ;-)

_________________
regards km


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2005, 8:46 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
I was just actually thinking that KM

I'll let ya know if it works


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2005, 9:21 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
that ain't working for me either.

I get thru the "password" part of the Runas cmd and then the msiexec pops up a help window for the all the command-line options

here's the litteral AHK command:
Code:
Run, runas /profile /user:ntdomain\bstrauss "%windir%\system32\msiexec.exe /i %windir%\- MMC -\Packages\RAdmin.msi", , UseErrorLevel



:x this is frustrating me to no end.

Please, keep bringing on the suggestions


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2005, 9:31 pm 
Offline

Joined: November 10th, 2005, 11:26 pm
Posts: 169
Location: Texas
I have found a 3rd party software:

http://www.tmgdevelopment.co.uk/setuputility.htm

that works as a workaround/go between. :)

It's a little sloppy :? , but I don't think as bad (with all due respect KM 8) ) as using the command line RunAS.

I still would like to resolve this problem for future use. :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 11th, 2005, 9:50 pm 
Offline

Joined: October 23rd, 2005, 9:14 pm
Posts: 18
Location: Germany, Stuttgart
A Runas replacement, maybe a solution for you...

http://www.joeware.net/win/free/tools/cpau.htm

_________________
regards km


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2005, 4:08 am 
Offline

Joined: October 7th, 2005, 9:46 pm
Posts: 13
Try using the /env switch on the windows RunAs command. That has worked for me in the past.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 12th, 2005, 11:30 am 
Offline

Joined: October 23rd, 2005, 9:14 pm
Posts: 18
Location: Germany, Stuttgart
Bartimus wrote:
that ain't working for me either.

I get thru the "password" part of the Runas cmd and then the msiexec pops up a help window for the all the command-line options


hm, in the meantime i tried it (use my script from above and called msiexec.exe in runas) and it worked perfekt on my PC!
I only receive the help window from msiexec, if somewhere inside the path to the msi-pakages there is a space! Don't use spaces an it works.

Btw, double quotes around he msi-path do not help (-> runas-error).
Any idea?

_________________
regards km


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group