#154040 - 2005-12-24 02:20 PM
RUNNAS - Tokenized Runas Utility
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Would like to introduce a new command line tool called RUNNAS.EXE (two n's) - its available only at KORG and you can get it here:
RUNNAS - Tokenized Runas Utility
It works much like Microsoft's standard runas.exe except for a few important features:
1) You can specify a password on the command line
2) You can tokenize the command line into a file.
3) You can execute the tokenized file.
This software is at first release and should be considered as beta. Please post any comments, suggestions or bugs to this space.
Documentation:
Code:
RUNNAS 1.14
Allows a user to run specific tools and programs with different permissions than the user's current logon provides.
Note: This version of runnas is not guaranteed to be compatible with the previous version. Please re-tokenize your files for added security.
SYNTAX:
runnas /user:<username> command [/password:<password>] [/noprofile] [/profile] [/env] [/netonly] [/logononly] [/wait] [/return] [/title:<title>] [/tokenize:<tokenfile>] [/crc] [/allowargs] [/<token>:<value>]
runnas tokenfile [/<token>:<value>] [/args:<arguments>] [/delete]
PARAMETERS:
/user <username> should be in form USER or DOMAIN\USER. command Command line to run. See below for examples /password The clear-text password for the user account. If not specified, you will be prompted for the password. /noprofile Specifies that the user's profile should not be loaded. This causes the application to load more quickly, but can cause some applications to malfunction. /profile Specifies that the user's profile should be loaded. This is the default. /env To use current environment instead of the user's /netonly Use if the credentials specified are for remote access only. /logononly Use if command is to be run during interactive logon only. /wait Wait for the program to finish. /return Return errorlevel of program. Use with /wait. /title For console processes, this is the title displayed in the title bar if a new console window is created. /tokenize Tokenize command line into <tokenfile>. /crc Calculate CRC (Cyclic Redundancy Check) of command line executable and save it to <tokenfile>. /allowargs Allow passing additional arguments to <tokenfile>. tokenfile The name of a tokenized command line file. /<token> Replace command line <token> with <value>. /args Additional <arguments>. Valid only if tokenfile was created with /allowargs switch. /delete Delete tokenfile when done.
NOTE: Enter user's password when prompted. NOTE: USER\DOMAIN is not compatible with /netonly. NOTE: /profile is not compatible with /netonly. NOTE: Most parameters can be shortened to 3 characters.
EXAMPLES:
> runnas /user:admin mmc > runnas /user:admin "cmd /c dir c:\ & pause" /password:xxx
Create and execute a tokenfile:
> runnas /user:admin notepad.exe /password:xxx /tokenize:notepad.tok > runnas notepad.tok
Pass quotes inside a quoted string (using \" metachar):
> runnas /user:admin "\"c:\program files\my app\app.exe\"" /pass:xxx
Pass arguments to a tokenfile:
> runnas /user:admin "notepad.exe" /pass:xxx /tok:notepad.tok /allowargs > runnas notepad.tok /args:"file.txt"
Replace tokens in a tokenfile:
> runnas /user:admin "notepad.exe <p1>.<p2>" /pas:xxx /tok:notepad.tok > runnas notepad.tok /p1:myfile /p2:txt
TERMS OF USE ------------
This software is provided "as is" and "with all faults". The author makes no representations or warranties of any kind concerning the quality, safety or suitabilty of the software, either express or implied, including without limitation any implied warranties of merchantability, or fitness for a particular purpose.
|
Top
|
|
|
|
#154046 - 2005-12-24 09:32 PM
Re: RUNNAS - Tokenized Runas Utility
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11622
Loc: CA
|
SWEET Shawn. I like it so far.
Have tested it on accounts with non admin privledges and the application will run but won't access areas they're not allowed to.
Have used Admin rights with different account and it runs as expected too.
As per one of Les' questions. Maybe add some code to hash/crc check that the executable has not been modified to include even a rename of the exe.
I like the idea that the tokenize overwrites the previous entry, but using a switch would it be possible to chain a couple commands?
So far it ROCKS dude.
Will test some more on Monday at work. May have to take a look at some reverse engineering some to see how easily / difficult it might be to reverse the obfuscation.
But don't think I'll get that much computing time in the next couple days.
|
Top
|
|
|
|
#154086 - 2006-01-20 05:11 PM
Re: RUNNAS - Tokenized Runas Utility
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
New version of runnas available (1.10) added the following features:
- /wait Wait for the program to finish.
- /return Return errorlevel of program. Use with /wait.
- /title For console processes, this is the title displayed in the
title bar if a new console window is created.
|
Top
|
|
|
|
#154088 - 2006-01-20 06:58 PM
Re: RUNNAS - Tokenized Runas Utility
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11622
Loc: CA
|
Quote:
How about a default behavior for the title parameter of: "<process> - <user>"?
Boy, talk about the new younger GUI age.
|
Top
|
|
|
|
#154098 - 2006-02-07 09:38 PM
Re: RUNNAS - Tokenized Runas Utility
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11622
Loc: CA
|
Recently came across this KB and thought it might be of some value if for nothing else some examples of how the Microsoft version works.
Secondary Logon (Run As): Starting Programs and Tools in Local Administrative Context http://support.microsoft.com/kb/225035
|
Top
|
|
|
|
#154099 - 2006-07-17 06:10 PM
Re: RUNNAS - Tokenized Runas Utility
|
imjin
Lurker
Registered: 2006-03-17
Posts: 4
|
Let me start off by saying that this is a great tool! This is my 1st post since I've usually been a lurker here while I learn KiXtart... I have a question on a possible future modification to runnas.
This tool is currently the only way I've been able to execute apps under an administrative context for our users at login, most of which are not local admins (teachers, students, etc..). We're in the process of migrating away from ScriptLogic due to renewal costs (to the tune of $250k) and I've been attempting to rebuild everything ScriptLogic did. I've pretty much got everything rebuilt with the exception of being able to execute a program (or script) under an administrative context and run it hidden. At login, one of the first things we do is run a "net localgroup" command from a batch file and add a series of domain groups to the local administrators group of each machine. Runnas does this beautifully, but I have to make a separate line for each execution, so if have 6 groups to add, it flashes up 6 windows. On the occasion where the group is already a part of the local administrators group, it will show the error 1378 (account name is already a member of the group) in the dos window. When the users see this, they think all hell is breaking loose because they just saw the word "error".
I've tried combining the RunEx UDF (which does a shellexecute) with Runnas unsuccessfully. I'm not sure if it had to do with requiring single/double quotes within each, but I gave up on that endeavor. I've tried a few other things like piping the stdout to NUL which works unless the accounts are already present, then the errors flash by in the dos window again. Is it possible to add another option that allows for hidden execution?
|
Top
|
|
|
|
#154102 - 2006-07-18 03:15 PM
Re: RUNNAS - Tokenized Runas Utility
|
imjin
Lurker
Registered: 2006-03-17
Posts: 4
|
I'm testing on XP SP2, but we've got 2000 SP4 out there as well. The 98 machines I just ignore, hoping they'll fall into a pit somewhere. Most of our user base are set as Power Users, so everything we'd need to use runnas would almost always require local admin to execute.
Here's the line I'm currently using that executes great, but in this sample I'm not trying to pipe the stdout anywhere, but because I have to do a "net localgroup" for every entry in the local administrators group, I've got 4 lines, each of which pops a dos window up, although it closes quickly. I put the Runnas.exe command in it's own function called RunAs($TargetApp) so I could shorten main line that calls it. Forgive the chr() commands... old VB habit and I have a few helpdesk techs that could be editing these scripts down the road and the multiple quote characters would probably throw them, and they'd leave out a triple-quote somewhere.
Code:
RunAs("net localgroup " + Chr(34) + "Administrators" + Chr(34) + " " + Chr(34) + "domain\domain admins" + Chr(34) + " /add") RunAs("net localgroup " + Chr(34) + "Administrators" + Chr(34) + " " + Chr(34) + "domain\integrators" + Chr(34) + " /add") RunAs("net localgroup " + Chr(34) + "Administrators" + Chr(34) + " " + Chr(34) + "domain\schoolsmca" + Chr(34) + " /add") RunAs("net localgroup " + Chr(34) + "Administrators" + Chr(34) + " " + Chr(34) + "domain\trfcmca" + Chr(34) + " /add") ; Function RunAs($TargetApp) Shell "%COMSPEC% /c runnas.exe /user:adminuserid " + Chr(34) + $TargetApp + Chr(34) + " /password:adminpassword" EndFunction
Normally, in ScriptLogic's app launcher we'd call a batch file that sits in the netlogon folder that has several things in it pertaining to these "net localgroup" commands and a few other cacls folder permission setting entries, so if I could call the batch file on one line, all the better. This was actually the way I first started trying to do it, by executing the teacher.bat file using Runnas.exe, but because the results dos window would appear every time displaying the "net localgroup" errors, I switched to the method above since it as least hide the failed "net localgroup" messages. I've tried adding a " > NUL" to each line in the batch file, which does hide successful commmand results, but any failed commands that error out show up in the popup dos window.
I just played around with Howard Bullock's GrpMaint tool which I'm thinking may be easier to use by passing a member file to it. Then it just logs failed group membership additions and doesn't fly em across the screen like the command prompt method does.
|
Top
|
|
|
|
#154103 - 2006-07-18 03:46 PM
Re: RUNNAS - Tokenized Runas Utility
|
bizcuts
Fresh Scripter
Registered: 2006-07-04
Posts: 10
|
sorry for posting in here, but i cant seem to see the make new thread/post button...and i have a few things i need to ask?
"n00b!!!!" yes i know... green as green can be
any help would good
|
Top
|
|
|
|
#154104 - 2006-07-18 04:22 PM
Re: RUNNAS - Tokenized Runas Utility
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Quote:
Tried adding " > NUL" to each line in the batch file, which does hide successful commmand results, but any failed commands that error out show up in the popup dos window.
To hide failed commands, add 2>NUL
|
Top
|
|
|
|
#154105 - 2006-07-18 04:48 PM
Re: RUNNAS - Tokenized Runas Utility
|
imjin
Lurker
Registered: 2006-03-17
Posts: 4
|
Always the last thing I seem to find... a typo.
If you're using Runnas.exe to fire off a batch file, is there a way to hide the DOS window the batch file spawns?
Edited by imjin (2006-07-18 07:12 PM)
|
Top
|
|
|
|
#154106 - 2006-11-09 04:26 PM
Re: RUNNAS - Tokenized Runas Utility
|
NewAtKix
Lurker
Registered: 2004-01-28
Posts: 3
Loc: x
|
Hi.. great utility..
I have a Q.
Is it possible to run the runnas.exe from network-drive like L:\folder\runnas.exe setup.tok??
Because when trying I get the following the error: "RUNNAS: The system cannot find the path specified"
Thx.. Ejner
|
Top
|
|
|
|
#154109 - 2006-11-09 05:20 PM
Re: RUNNAS - Tokenized Runas Utility
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Quote:
Is it possible to run the runnas.exe from network-drive like L:\folder\runnas.exe setup.tok??
Tricky.
When you run in the context of another user you normally create a new environment, and that environment does not have the mapped drives of the session that you started the command in.
This means that the process is effectively orphaned from the drive on which it started, so of course cannot find the file to open it.
Clear?
|
Top
|
|
|
|
#170824 - 2006-11-29 12:57 PM
Re: RUNNAS - Tokenized Runas Utility
[Re: Richard H.]
|
darkblueturbo
Lurker
Registered: 2006-07-24
Posts: 3
|
On a similar vain I'm getting the error "unknown command [runnas]" when trying the simple example script of "runnas /user:admin mmc"
I've tried runnas.exe and the full path to runnas.exe, as mentioned above, but still get the same error.
I'm obviously being quite thick here - the runnas.exe file is in the same directory as kix32.exe - so just wondered if anyone could help.
This is before I start looking at tokenizing files and suchlike, which is liable to get my very basic knowledge of Kix very condfused...
Thanks for any help guys...
|
Top
|
|
|
|
#174270 - 2007-02-26 04:42 PM
Re: RUNNAS - Tokenized Runas Utility
[Re: Shawn]
|
Huron
Lurker
Registered: 2007-01-31
Posts: 1
|
I'm not usually active with posts on the board since I'm more of a silent reader, but in this case I wanted to make an exception to thank you personally Shawn.
I've been looking at 'the best way for me' to perform some actions with admin privs calling one loginscript from the other. And I've tested a whole bunch of tools/ways to do this.
But I'm impressed by the simplicity and quality of your RUNNAS.EXE tool. I got it to work doing what I wanted in less than no time at all.
I was almost ready to start building my own runas tool, but I'm not going to reinvent the wheel since your tool has all I need.
I'm using this in a multi-site corporate environment with about 1000 workstations. And it's working like a charm.
Kudo's Shawn !
Greetz,
Huron.
|
Top
|
|
|
|
#180329 - 2007-09-10 04:57 AM
Re: RUNNAS - Tokenized Runas Utility
[Re: Huron]
|
babyjosef17
Lurker
Registered: 2007-09-10
Posts: 2
|
I need you help on this one pls.
I want to remotely install SAP on the network.
i wanted to make a bacth file, that later I can insert to the logon script.
I keep getting the error:
RUNNAS: Access is Denied.
here is my bat file for your review:
@Echo off
\\sgnas1\library\General\Install\SAP\runnas /user:username "sap.bat" /password:password
and here are the contents of that sap.bat:
@Echo off
L:\General\Install\SAP\SapFrontEnd640\Setup\SapSetup /install /checkdb /p:"Mhis"
I also tried not using the sap.bat ang typing the installation command directly like so:
\\sgnas1\library\General\Install\SAP\runnas /user:username "L:\General\Install\SAP\SapFrontEnd640\Setup\SapSetup /install /checkdb /p:"Mhis"" /password:password
but keep getting this error Runnas: Cannot find the specified path
pls help is there anything wrong in the code or maybe some mo attributes to add. Thank you very much
|
Top
|
|
|
|
#180340 - 2007-09-10 06:20 AM
Re: RUNNAS - Tokenized Runas Utility
[Re: Les]
|
babyjosef17
Lurker
Registered: 2007-09-10
Posts: 2
|
tnx for the reply.
That's the thing. L:\ drive is standard in all our workstation so every pc has it. Really having trouble with this one. 
is there a way for runnas to lets say, use the instalation folder in the server machine? so i would not use a network drive folder anymore.
|
Top
|
|
|
|
#187026 - 2008-04-17 05:36 PM
Re: RUNNAS - Tokenized Runas Utility
[Re: Les]
|
Rixter
Fresh Scripter
Registered: 2005-03-15
Posts: 15
|
Shawn,
I'm trying to use your RUNNAS to perform the MXLOGIN.CMD command file for Vista users to login to our network. My MXLOGIN.KIX runs fine but the portion before that using XCOPY is where I get stuck.
I've created an XCOPY.TOK file using the syntax: (using a real acct and password) runnas /user:domainadmin "xcopy.exe" /pass:acctpwd /tok:xcopy.tok /logononly
Now I'm not at all sure how to take the XCOPY.TOK (which by the way is the version that comes with Vista) and actually incorporate it into my logon script.
Can you please help me out? Thanks VERY much!
MXLOGON.CMD: @echo off if exist %systemdrive%\kix32.exe goto logon xcopy %0\..\*.exe c:\ >nul :logon REM %0\..\Kix32.exe %0\..\MXlogin.kix %systemdrive%\Kix32.exe %0\..\MXlogin.kix if errorlevel 1 copy %0\..\*.exe %systemdrive%\ >nul exit
|
Top
|
|
|
|
#187047 - 2008-04-17 09:21 PM
Re: RUNNAS - Tokenized Runas Utility
[Re: Shawn]
|
Rixter
Fresh Scripter
Registered: 2005-03-15
Posts: 15
|
Shawn,
Sorry for the confusion. I ment that I'm using the version of XCOPY.EXE that comes with Vista.
I've created an XCOPY.TOK file using the syntax: (using a real acct and password) runnas /user:domainadmin "xcopy.exe" /pass:acctpwd /tok:xcopy.tok /logononly
Now I'm not at all sure how to take the XCOPY.TOK (which by the way is the version that comes with Vista) and actually incorporate it into my logon script.
|
Top
|
|
|
|
#187052 - 2008-04-17 10:11 PM
Re: RUNNAS - Tokenized Runas Utility
[Re: Mart]
|
Rixter
Fresh Scripter
Registered: 2005-03-15
Posts: 15
|
Mart,
That makes more sense to me. The problem is, and maybe I'm going about this all wrong, is that in order to run the login script, which for us is a AD profile setting not a GPO, KIX32.EXE is copied locally to C:\. In my LOGIN.CMD file I have the following:
if exist %systemdrive%\kix32.exe goto logon copy %0\..\*.exe c:\ >nul :logon %systemdrive%\kix32.exe %0\..\login.kix if errorlevel 1 copy %0\..\*.exe %systemdrive%\ >nul exit
LOGIN.KIX works fine, it's just the copying of KIX32.EXE locally doesn't work without elevated priviledges for Vista. Do you think there's a better way of me doing this?
|
Top
|
|
|
|
#190588 - 2008-11-15 02:15 AM
Re: RUNNAS - Tokenized Runas Utility
[Re: Shawn]
|
JJ1
Just in Town
Registered: 2008-11-15
Posts: 4
|
It is possible to create a new parameter for the next release from RUNNAS? It would be great to have a add. parameter "/hide" to hide the window for the starting program / process.
The background is that I want start admin tasks, where the window is hidden or shown and the program waits or run async. --> the last point "/wait" is already exist "/wait Wait for the program to finish.".
I have try to realise it (hide the window) with the UDF RunEx or with some WSH code, but without any result . I think it works to hide the program runnas.exe but I can not hide the new starting process from the runnas utility .....
Here my current example code that should be "Pre-tokenizing", but the $HIDE=1 part is not working (hide and wait) :
Function runas($cmd,$hide,$wait)
Dim $User, $Pass, $runnas
$User = "DOMAIN\LOGONADMIN"
$Pass = "secret"
If Check_Server() = 0
IF $LOGGING WriteLog ("RunAs - Script not running on an Logonserver -> quit logon script - " + $Server) ENDIF
Quit
ENDIF
$runnas = @SCRIPTDIR + '\Tools\RunAs\runnas.exe'
IF $HIDE = 1
IF $WAIT = 1
RunEx($runnas, '/user:' + $User + ' "' + $cmd + '" /password:' + $Pass + ' /ENV /WAIT')
ELSE
RunEx($runnas, '/user:' + $User + ' "' + $cmd + '" /password:' + $Pass + ' /ENV')
ENDIF
ELSE
IF $WAIT = 1
SHELL $runnas + ' /user:' + $User + ' "' + $cmd + '" /password:' + $Pass + ' /ENV /WAIT'
ELSE
RUN $runnas + ' /user:' + $User + ' "' + $cmd + '" /password:' + $Pass + ' /ENV'
ENDIF
ENDIF
EndFunction
Or exist any other solution to hide the starting program? I have try to search the forum but I have not found a solution.
I think I can it also build it up with AutoIT but with this I miss the parameter "/ENV" .....
|
Top
|
|
|
|
#190597 - 2008-11-15 07:21 PM
Re: RUNNAS - Tokenized Runas Utility
[Re: Lonkero]
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
|
Top
|
|
|
|
#190632 - 2008-11-18 11:34 AM
Re: RUNNAS - Tokenized Runas Utility
[Re: NTDOC]
|
JJ1
Just in Town
Registered: 2008-11-15
Posts: 4
|
A Shell out to the program should be hidden using the CMD redirects Mmm, ok this works for this case:
runas('%windir%\system32\cacls.exe %windir%\BGInfo.bmp /E /C /G "Users":F' > nul,1,0) but not for this:
runas("\\myserver\ofcscan\AutoPcc.exe > nul",1,0) Currently I use a own program with Autoit to hide and start the program, but want use in the future the runnas utility, so it would be nice the have an /HIDE switch ...., or have anybody an other idea to hide the window for an .exe file?
Edited by JJ1 (2008-11-18 11:35 AM)
|
Top
|
|
|
|
#190634 - 2008-11-18 03:03 PM
Re: RUNNAS - Tokenized Runas Utility
[Re: JJ1]
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4541
Loc: USA
|
|
Top
|
|
|
|
#190635 - 2008-11-18 04:07 PM
Re: RUNNAS - Tokenized Runas Utility
[Re: Allen]
|
JJ1
Just in Town
Registered: 2008-11-15
Posts: 4
|
Yes, thank you this helps for the AutoPcc.exe .....
BUT my wish with the "/HIDE" parameter is maybe also for application where it is not so easy to hide the output. I think it can be a usefull parameter...., and with it you (or better I ) must not search for other "tricks" to hide the output (?).
|
Top
|
|
|
|
#190679 - 2008-11-20 02:40 AM
Re: RUNNAS - Tokenized Runas Utility
[Re: Allen]
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11622
Loc: CA
|
No the CMD shell does not pop open. I use it all the time. The only reason you might see it is if you don't redirect it to nul or if it's just some odd behaving application that spews junk no matter what.
Here is an example
SHELL '%COMSPEC% /C "\\MYSERVER\SHARE2\WHOAMI.EXE" >NUL 2>NUL'
|
Top
|
|
|
|
#190696 - 2008-11-20 03:09 PM
Re: RUNNAS - Tokenized Runas Utility
[Re: NTDOC]
|
JJ1
Just in Town
Registered: 2008-11-15
Posts: 4
|
This will be my last post in this thread maybe I should open a new post in the beginners section with the topic "What shell redirects are possible" . I have try a lot of combination with redirects but all without any good result.
My question is how can I hide any window from the starting program? --> when I start the program with the runnas.exe! I my example below it open every time the "CMD.EXE" window, of course I can hide the output in the CMD.EXE window, but not the window itself.
Maybe someone can show me in my small example how I can HIDE any output/window from my starting program (example 1 and 2)?
$rc = SetOption('NoVarsInStrings','ON')
$rc = SetOption('Explicit','ON')
; File _dir.cmd
;@ECHO OFF
;DIR %WINDIR% > %1\out.txt
; Example 1
runas(@SCRIPTDIR + '\_dir.cmd ' + @SCRIPTDIR)
; Example 2
;runas('%comspec% /c dir %WINDIR% > ' + @SCRIPTDIR + '\out.txt')
Function runas($cmd)
Dim $User, $Pass, $runnas
$User = "DOMAIN\USER"
$Pass = "PASSWORD"
$runnas = @SCRIPTDIR + '\runnas.exe'
RUN $runnas + ' /user:' + $User + ' "' + $cmd + '" /password:' + $Pass + ' /ENV /WAIT'
EndFunction
So I think it would be a good idea the have an extra switch, as example /HIDE, to hide any output/window from programs which are started with the runnas.exe.
In the meanwhile I have play with AutoIt and now I have an similar function with my "_RunAs.exe", is this possible with the runnas.exe in a similar way -> redirect or whatever?
As example what I mean my AutoIt code......
#NoTrayIcon
; PARAMETER
; _RunAs /user:USERNAME "command" /password:PASSWORD [/HIDE] [/WAIT]
If $CmdLine[0] > 2 Then
$Username = StringSplit ( $CmdLine[1], ":")
If $Username[1] = "/user" Then
$Username = $Username[2]
Else
_help()
EndIf
$Domain = StringSplit ( $Username, "\")
If @error Then
$Domain = @ComputerName
Else
$Username = $Domain[2]
$Domain = $Domain[1]
EndIf
$CMD = $CmdLine[2]
$Password = StringSplit ( $CmdLine[3], ":")
If $Password[1] = "/password" Then
$Password = $Password[2]
Else
_help()
EndIf
Else
_help()
EndIf
If $CmdLine[0] > 3 Then
If $CmdLine[4] = "/HIDE" Then
$Window = @SW_HIDE
Else
$Window = @SW_MAXIMIZE
EndIf
Else
$Window = @SW_MAXIMIZE
EndIf
If $CmdLine[0] < 5 Then
$WAIT = "/NOWAIT"
Else
$WAIT = $CmdLine[5]
EndIf
If $WAIT = "/WAIT" Then
RunAsWait($Username, $Domain, $Password, 0, $CMD, @TempDir,$Window)
Else
RunAs($Username, $Domain, $Password, 0, $CMD, @TempDir,$Window)
EndIf
exit 0
Func _help()
MsgBox(64,'Help','_RunAs.exe /user:USERNAME "command" /password:PASSWORD [/HIDE] [/WAIT]' & @CRLF & @CRLF & '<USERNAME> should be in form USER or DOMAIN\USER.')
Exit
EndFunc
Edited by JJ1 (2008-11-20 05:22 PM)
|
Top
|
|
|
|
#196042 - 2009-09-23 03:42 PM
Re: RUNNAS - Tokenized Runas Utility
[Re: JJ1]
|
Qnix
Just in Town
Registered: 2009-09-23
Posts: 1
Loc: a
|
Hi guys,
First of all many thanks for all the great tools. Secondly I want to launch the logon script in NT4 with admin rights and colon is not an allowed character so /user:user doesn't work for example. Could you perhaps add an alternative character as well? Space would do fine, to have runnas.exe abc.exe /user user /pass pass, instead of runnas.exe abc.exe /user:user /pass:pass? Or another allowed character for the logon script name string under NT4. It would save me a lot of headache! 
Again, many thanks!
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 306 anonymous users online.
|
|
|