Page 1 of 1 1
Topic Options
#44043 - 2003-08-14 03:03 PM RUNAS AND SENDKEYS
Iggy Offline
Fresh Scripter

Registered: 2002-11-08
Posts: 27
Loc: Lexington ma.
I know this has been asked before, but I really need help with sending the password with the use of sendkeys. I need to get this done quick, so any help I will appreciate. based on looking through previous post I tried the follwing with no luck. what is the proper code that I will need.

Thanks.

shell "%COMSPEC% /e:1024 /c copy P:\Security_Patches\Windows2000-KB823980-x86-ENU.exe c:\KB823980.exe"
;settitle ("test")
;if setfocus ('test') = 0
shell "%COMSPEC% /e:1024 /c runas /user:@WKSTA\administrator c:\KB823980.exe
sendkeys("password{enter}")
;endif

Top
#44044 - 2003-08-14 03:12 PM Re: RUNAS AND SENDKEYS
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
as far as I remember, the old posts said that it's impossible.
do I remember wrong?

you can try adding a sleep in there.
but indeed this is no way to go.
_________________________
!

download KiXnet

Top
#44045 - 2003-08-14 03:14 PM Re: RUNAS AND SENDKEYS
Iggy Offline
Fresh Scripter

Registered: 2002-11-08
Posts: 27
Loc: Lexington ma.
If this is no way to go, can you point me in the right direction.
Top
#44046 - 2003-08-14 03:24 PM Re: RUNAS AND SENDKEYS
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
here is one:
http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=2;t=004498;p=3

note, the inserting of the password must be "automated" without a change of user interference.
_________________________
!

download KiXnet

Top
#44047 - 2003-08-14 04:04 PM Re: RUNAS AND SENDKEYS
cellnet Offline
Starting to like KiXtart

Registered: 2002-02-26
Posts: 115
Loc: Sweden
not the right way to go, but it works

kix code

code:
 
Run '%comspec% /c wscript x:\script\vbs\runas.vbe'
sleep 2


Here is the vbs scritp uncoded

code:
 Dim vbOK: vbOK = 1
Dim vbCancel: vbCancel=2
Dim Wshell, ret, msg01, msghdr01, strUser, strPass
Dim CompName: CompName="Blank"

Set WshNetwork = WScript.CreateObject("WScript.Network")
CompName = WshNetworK.ComputerName
Set WshNetwork = nothing

function execute()
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "%windir%\system32\runas.exe /user:" & strUser & " " & Chr(34)& "Searchpathtokix32\kix32.exe \\Server_name\folder\of\kix_script\Name_of_kix_script.kix" & Chr(34)
Wscript.Sleep 100
WshShell.AppActivate "runas"
wScript.Sleep 100
WshShell.SendKeys strPass & "~"
wScript.Sleep 100
Wscript.Quit
end function

'** Start Encode **
strUser="my_domain\admin_account"
strPass="xxxxxx"
execute()

Replace search paths and useraccounts
Vbs starts a kix script with admin rights, install from there

To encode the vbs file and create the vbe file
from the command promt:
code:
 screnc.exe my_vbsfile.vbs myencodedvbs.vbe 

\erik

Top
#44048 - 2003-08-14 04:09 PM Re: RUNAS AND SENDKEYS
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
that is just the same as running with kix.
the same problem already mentioned.

it needs sleep and it can be screwed by user.
_________________________
!

download KiXnet

Top
#44049 - 2003-08-14 04:14 PM Re: RUNAS AND SENDKEYS
Iggy Offline
Fresh Scripter

Registered: 2002-11-08
Posts: 27
Loc: Lexington ma.
Lonkero you seem to be very crypitic in all of your responses. Is there or is there not a way to do this. a simple example of code if possible would be of great help.

Thanks.

Top
#44050 - 2003-08-14 04:24 PM Re: RUNAS AND SENDKEYS
cellnet Offline
Starting to like KiXtart

Registered: 2002-02-26
Posts: 115
Loc: Sweden
yes sometimes the user disrupts the script.

Trying to minimze the times the runas.kix are executed

8/10 it works

But I havent seen that the hole password been displayed to the user.

In lack of anything else to use I have to stick with it.

Su.exe or scripting towards the scheduler service is not an option for my.

Do you have any other suggestion

\erik

Top
#44051 - 2003-08-14 04:29 PM Re: RUNAS AND SENDKEYS
Richie19Rich77 Offline
Seasoned Scripter
*****

Registered: 2002-08-16
Posts: 624
Loc: London, England
Just need to ask a few simple questions.

1. Are the PC's you updating on a AD domain.
2. What O/S are the PC's.
3. If they are non domain PC's, is the local administrator password the same on all the PC's.

I have just deployed the MS Patch to 2000 PC's across our Domain, just used Jens Schelduler to roll it out.

quote:
Su.exe or scripting towards the scheduler service is not an option for my.

Why is this not an option ???

[ 14. August 2003, 16:33: Message edited by: Richard Farthing ]

Top
#44052 - 2003-08-20 10:13 PM Re: RUNAS AND SENDKEYS
marguz Offline
Fresh Scripter

Registered: 2002-10-29
Posts: 19
Loc: Illinois
I have a VBS script that I use to install the ICA web client on our end users boxes. We have them LOCKED down so they can't do sh&t! So I needed a way to install this without me touching all the boxes as the administrator. On google I found a nice VBS script that works GREAT, the password is saved in the script and them I encode it so the user can't open it. I can email it to someone if they want.
Top
#44053 - 2003-08-21 09:58 AM Re: RUNAS AND SENDKEYS
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Make a MSI package....
_________________________
Co


Top
#44054 - 2003-08-21 06:15 PM Re: RUNAS AND SENDKEYS
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Making a .MSI package does not necessarily solve the problem of requiring administrative privileges to install said package.
_________________________
There are two types of vessels, submarines and targets.

Top
#44055 - 2003-08-21 07:25 PM Re: RUNAS AND SENDKEYS
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
iggy, the fast and working do not cross.
anyway, easiest way to do elevated stuff is task scheduling.

but for that you would need to build some more logic to it and thus it would not be fast.
_________________________
!

download KiXnet

Top
#44056 - 2003-08-21 11:01 PM Re: RUNAS AND SENDKEYS
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
I didn't create the package but we use an Executable created with WFWI. It includes an administrator account and password. This executable can call other executables, MSI, Batch , etc.

Try to make something like that. If you haven't the source you can't see the account and password.
_________________________
Co


Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.079 seconds in which 0.038 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org