Jump to content

RunAs Admin


thepip3r
 Share

Recommended Posts

Purpose: If you work in a network environment where your normal account has no administrative rights yet you manage your computer, computers, and/or networks by a completely separate user account that does have admin rights over machines/networks/etc, this program helps facilitate the limitations of the Windows system (on 2000/XP Pro).

Nutshell: Instead of having to right-click an executable and "runas" all of your admin-related programs and pass your admin credentials each time you want to use that program, just right-click this executable and then through process inheritence, every process spawned from within this program's window, runs with the admin account credentials you passed once.

History: I've written this program as a batch file, vbs, hta, and now in auto-it -- each with their own differences and limitations which have forced me to rewrite them in a different language that facilitated changes requested by users of them.

My request to the forum-goers: Please try out this program and let me know what you think. I'd love constructive criticism and/or feedback on likes, dislikes, requests for changes, etc, etc.

Currently this only works on 2000/XP Pro due to me shying away from Vista due to all of it's problems -- I'll eventually run it on Vista and start troubleshooting code but right now, this would only work on Windows 2000 Pro and XP Pro.

Edit(s):

30June2009

- updated a number of problems relating to the conf file and the tab displaying correctly

- cleaned up much of the code.

expect more updates soon

07Aug2008

- Change Help > About information so it displays an email address I actually use.

- Removed path check for custom programs so you can specify executables that can take advantage of Shell Execution.

- Added some System Tray functions to further simplify program management.

* files updated to current.

Pls email me feature requests or bugs so I can fix them (pls be as specific as possible).

RunAs_Admin.exe

Edited by thepip3r

My Additions:- RunAs AdminDeviant Fun:- Variable Sound Volume

Link to comment
Share on other sites

  • 3 weeks later...

I would like to use this but I get errors when trying to run and or compile it. Any thoughts?

Line 13:
Opt("RunErrorsFatal",0)
Error: Unknown option or bad parameter specified
Remove that line

Opt("RunErrorsFatal") is no longer supported.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Ouch!

Okay I don't know what's up but this is what I get when I try to run it in the script editor:

D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(250,120) : WARNING: $WS_OVERLAPPEDWINDOW: possibly used before declaration.
$mainWindow =   GUICreate("RunAs Admin - " & @LogonDomain & "\" & @UserName, 400, 325, -1, -1, BitOR($WS_OVERLAPPEDWINDOW,
~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(250,138) : WARNING: $WS_CLIPSIBLINGS: possibly used before declaration.
$mainWindow =   GUICreate("RunAs Admin - " & @LogonDomain & "\" & @UserName, 400, 325, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)
~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(304,94) : WARNING: $SS_SIMPLE: possibly used before declaration.
$mainFormStatusBar = GUICtrlCreateLabel ($mainFormStatusDefault,0,290,420,16,BitOr($SS_SIMPLE,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(304,105) : WARNING: $SS_SUNKEN: possibly used before declaration.
$mainFormStatusBar = GUICtrlCreateLabel ($mainFormStatusDefault,0,290,420,16,BitOr($SS_SIMPLE,$SS_SUNKEN)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(525,29) : WARNING: $CAFullPath: possibly used before declaration.
        GUICtrlSetData($CAFullPath,
        ~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(533,39) : WARNING: $CANickname: possibly used before declaration.
    Local $nick = GUICtrlRead($CANickname)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(535,40) : WARNING: $CAArguments: possibly used before declaration.
    Local $args = GUICtrlRead($CAArguments)
    ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(552,31) : WARNING: $progConfCustom: possibly used before declaration.
    If FileExists($progConfCustom)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(555,8) : ERROR: syntax error
    ElseIf
    ~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(556,108) : ERROR: syntax error
        errHandler(100,"Error Locating File", "An error occurred while trying to locate " & $progConfCustom & ".")
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(559,68) : ERROR: syntax error
    $t = FileWriteLine($null, $nick & "," & $fp & "," & $args & @CRLF)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(560,18) : ERROR: syntax error
    If $t <> 1 Then errHandler
    ~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(560,124) : ERROR: syntax error
    If $t <> 1 Then errHandler(101,"Error Writing File", "An error occurred while trying to write to " & $progConfCustom & ".")
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(581,28) : ERROR: syntax error
    $ub = Ubound($arrDelete)-1
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(583,32) : ERROR: syntax error
        If $arrDelete[$i] <> "" Then GUICtrlDelete
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(643,72) : WARNING: $WS_CAPTION: possibly used before declaration.
    $about = GuiCreate("Help > About", 215, 150, -1, -1, BitOR($WS_CAPTION,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(643,84) : WARNING: $WS_SYSMENU: possibly used before declaration.
    $about = GuiCreate("Help > About", 215, 150, -1, -1, BitOR($WS_CAPTION,$WS_SYSMENU)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(665,69) : WARNING: $GUI_SS_DEFAULT_BUTTON: possibly used before declaration.
    GUICtrlCreateButton ("OK",65,115,75,23,BitOr($GUI_SS_DEFAULT_BUTTON,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(665,88) : WARNING: $BS_DEFPUSHBUTTON: possibly used before declaration.
    GUICtrlCreateButton ("OK",65,115,75,23,BitOr($GUI_SS_DEFAULT_BUTTON, $BS_DEFPUSHBUTTON)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(684,21) : WARNING: $about: possibly used before declaration.
    GUIDelete($about)
~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(773,11) : WARNING: $RSPC: possibly used before declaration.
    If $RSPC =
    ~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(856,18) : ERROR: $fp already declared as parameter
    Dim $newMenu,$fp,
    ~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(856,38) : ERROR: $menu already declared as parameter
    Dim $newMenu,$fp,$file,$search,$menu,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(250,120) : ERROR: $WS_OVERLAPPEDWINDOW: undeclared global variable.
$mainWindow =   GUICreate("RunAs Admin - " & @LogonDomain & "\" & @UserName, 400, 325, -1, -1, BitOR($WS_OVERLAPPEDWINDOW,
~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(333,43) : ERROR: __menuCustomDelete(): undefined function.
GUICtrlSetOnEvent(-1, "__menuCustomDelete")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3(597,41) : ERROR: __menuCustomLinkDelete(): undefined function.
        __menuCustomLinkDelete($sSelectedIndex)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\Usrbk\AutoItScripts\RunAs Project\RunAs_Admin.au3 - 12 error(s), 14 warning(s)
The SuperFlyChetGuy
Link to comment
Share on other sites

open the help file and go to History / Change log.

Read the changes and also follow the link to Script breaking changes at the top of that page.

The RunAS_Admin.au3 you are trying to use is old and the #includes need to be changed in it.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

  • 3 months later...
  • Developers

me too, getting errors...

...and ???????

You fixed it I assume or you just wanted to let us know it has errors since you upgrade the AutoIt3 version?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@ the people whining about vista support

It seems like it was designed for XP and rightly so.

[quote name='PsaltyDS' post='635433' date='Jan 27 2009, 07:04 AM']Larry is a mass murderer?! It's always the quiet, clean cut, bald guys... [/quote]

Link to comment
Share on other sites

  • 10 months later...

haha... i never knew the .au3 file was in such bad shape when i had it posted originally -- sorry for all of the bugs. Many of them have been resolved and I'm only posting the exe from now on as I'm going to be expanding the functionality considerably. Let me know if anyone has any feature requests.

My Additions:- RunAs AdminDeviant Fun:- Variable Sound Volume

Link to comment
Share on other sites

  • 3 weeks later...

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...