Re: Is It possible to run a script as admin?

From: Joe Earnest (joeearnestNO_at_SPAMqwest.netPLEASE)
Date: 04/14/04


Date: Wed, 14 Apr 2004 11:12:33 -0600

Hi,

"news.microsoft.com" <Richard@RaptorCon.net> wrote in message
news:#FV3oJkIEHA.3720@tk2msftngp13.phx.gbl...
> If the device is Win2K or WinXP, you can use RunAs, however Runas will
only
> work with an exe and you'll also have to specify a password (unencrypted).
>
> The best way to do this is to use a program (Wise Installer is what I use)
> to compile your code in an exe.
> You'll still have the problem of passing the password, the way I have done
> this in the past is to;
> Create an exe with your compiled code.
> Create another exe that calls RunAs+.exe (a microsoft scriptable runas
> available on the net).
> Then you call runas+ to run the 1st exe in admin context passing
it
> the necessary parameters (& password).
>
> SMS Installer could be used but be aware that it can be decompiled by
> another SMSInstaller user and read the password.
> I would also suggest:
> * Putting the password in split up string variables for more security
> * Try to place all the code necessay and date encode it so that if
someone
> was to get ahold of the exe (1st one complied in the 2nd one) then there
> would not be any danger of them passing other arguments to run other code
in
> admin context.
>
>
> If you were using WMI to connect to a remote box, then you could connect
as
> alterante credentials, however this is not possible when called from the
PC
> itself.
>
> Richard
>
>
> "cseeger" <cseeger@nospam.nospam> wrote in message
> news:Xns94CB76449FCAEcseegerinteractivede@207.46.248.16...
> > cseeger <cseeger@nospam.nospam> wrote in
> > news:Xns94CB756302C5Bcseegerinteractivede@207.46.248.16:
> >
> > > Is it possible for me to run a script with administrator rights? From
a
> > > regular domain user account???
> > >
> > > thanks!!
> > >
> > > -cseeger
> > >
> >
> > Sorry, I should elaborate. I wrote a script that requires the user have
> > admin access. I dont want to grant that. Infact, the script is a logon
> > script. If I could just allow admin access for the logon script I'd be
> > set.
> >
> > So, is there a way to elevate the account status to admin, just to run
> > the script. Then switch the account status back to normal user????
> >
> > thanks!
> >
> > -cseeger
>

Just a quick note. The new version 3 of AutoIt (the script, not the AutoItX
COM add-on) now has sufficent methods to write most logon scripts. AutoIt
script also compiles to an EXE.

Hiddensoft freeware
www.hiddensoft.com/autoit/

Joe Earnest



Relevant Pages

  • Re: Is It possible to run a script as admin?
    ... > use) to compile your code in an exe. ... I wrote a script that requires the user ... If I could just allow admin access for the logon script ... I didnt even know runas existed in cmd line form! ...
    (microsoft.public.scripting.vbscript)
  • Re: Is It possible to run a script as admin?
    ... If the device is Win2K or WinXP, you can use RunAs, however Runas will only ... work with an exe and you'll also have to specify a password. ... I wrote a script that requires the user have ... If I could just allow admin access for the logon script I'd be ...
    (microsoft.public.scripting.vbscript)
  • Re: convert VB script code to vb (cheap & dirty)
    ... an exe, there are other "cheap-and-dirty" ways to do it. ... of the compiler, the runtime, your script and a little ... the compiler, the runtime and your source code into temporary ... running your vbs with wscript). ...
    (microsoft.public.scripting.vbscript)
  • Re: exe file
    ... "Train my users"? ... An EXE, ... than a VBS script at doing just about anything. ... to convey the general difference between compiled code ...
    (microsoft.public.scripting.vbscript)
  • Re: Cross Site Scripting for .exe?
    ... How can an exe take in these ... > number and no other info...How do i find out if my script has been ... The error message thrown probably, depending on method, does ... webserver input file input file from the DB checked for other keyword ...
    (alt.computer.security)