#76955 - 2003-10-01 02:45 PM
Why dos RUNAS not work with in .kix
|
ulro
Fresh Scripter
Registered: 2003-09-25
Posts: 9
Loc: Denmark
|
Hi I’ve bin reading all the instructions in topic "Runas like SU... Scripted without console!!!" and tried different things....
So now I’m trying to start a simple RUNAS command from a .kix
First I did at test of the RUNAS from cmd:
- Runas /env /user:nt\administrator cmd - entered the password and it worked fine!
then I’ve made this .kix:
$USER = "administrator" $PASSWORD = "due2keho"
run 'runas /env /user:nt\$USER cmd'
sendkeys("$PASSWORD{ENTER}")
I’m starting the .kix with this .cmd:
@echo off REM echo run MM6_11_d.exe
\\CWTCPH06\multimark\KIX_install\kix32.exe \\CWTCPH06\multimark\KIX_install\test.kix
and now I’m getting this error:
Enter the password for nt\administrator: Attempting to start cmd as user "nt\administrator" ... 0Press any key to continue . . . RUNAS ERROR: Unable to run - cmd 267: The directory name is invalid.
any ideas??
|
|
Top
|
|
|
|
#76957 - 2003-10-01 03:54 PM
Re: Why dos RUNAS not work with in .kix
|
ulro
Fresh Scripter
Registered: 2003-09-25
Posts: 9
Loc: Denmark
|
Hi agin
Thanks Chris S. i know about the lack security now i'm just trying to get this to work!
Now i tried this : $USER = "administrator" $PASSWORD = "due2keho"
run 'runas /env /user:nt\$USER "cmd"' SetFocus("c:\windows\system32\cmd.exe") sendkeys("$PASSWORD{ENTER}")
i've still get the error:
Enter the password for nt\administrator: Attempting to start cmd as user "nt\administrator" ... 0Press any key to continue . . . RUNAS ERROR: Unable to run - cmd 267: The directory name is invalid.
any other suggestions ??
|
|
Top
|
|
|
|
#76959 - 2003-10-01 04:33 PM
Re: Why dos RUNAS not work with in .kix
|
ulro
Fresh Scripter
Registered: 2003-09-25
Posts: 9
Loc: Denmark
|
Hi Lonkero i supose like this:
$USER = "administrator" $PASSWORD = "due2keho"
run 'runas /env /user:nt\$USER "%comspec% /c cmd"'
SetFocus ("C:\WINDOWS\System32\cmd.exe") = 0
SendKeys ("$PASSWORD{ENTER}")
or ?
but still errors :
1Enter the password for nt\Administrator: " ...pting to start C:\WINDOWS\system32\cmd.exe /c cmd as user "nt\Administrator 0Press any key to continue . . . RUNAS ERROR: Unable to run - C:\WINDOWS\system3 2\cmd.exe /c cmd 267: The directory name is invalid.
|
|
Top
|
|
|
|
#76963 - 2003-10-02 11:41 AM
Re: Why dos RUNAS not work with in .kix
|
Richie19Rich77
Seasoned Scripter
   
Registered: 2002-08-16
Posts: 624
Loc: London, England
|
code:
CD 'C:\' ;Run From Local Drive Shell '%COMSPEC% /c RunAs.exe /user:Administrator "C:\Windows\Notepad.exe" | %%KIXCRYPTDIR%%\sanur.exe {Password}'
Works for me, drop "| %KIXCRYPTDIR%\sanur.exe {Password}" if you want it to prompt for password.
If you are going to use RunAs, use sanur.exe to push the password to RunAs, SendKeys is so unrealiable.
Looking at your code, You have a Server with a domain called "NT" ?? [ 02. October 2003, 11:52: Message edited by: Richard Farthing ]
|
|
Top
|
|
|
|
#76968 - 2003-10-03 07:57 PM
Re: Why dos RUNAS not work with in .kix
|
Paul_Berquam
Hey THIS is FUN
Registered: 2000-08-02
Posts: 310
Loc: Sacramento, CA USA
|
Actually what I meant to post was
"Have you tried running this from your local machine using a local path and a local system account, to verify that it's not a permissions based problem." [ 03. October 2003, 19:58: Message edited by: Paul_Berquam ]
_________________________
He was a good little monkey and always very curious...
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 1198 anonymous users online.
|
|
|