#44043 - 2003-08-14 03:03 PM
RUNAS AND SENDKEYS
|
Iggy
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
|
|
|
|
#44045 - 2003-08-14 03:14 PM
Re: RUNAS AND SENDKEYS
|
Iggy
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
|
|
|
|
#44047 - 2003-08-14 04:04 PM
Re: RUNAS AND SENDKEYS
|
cellnet
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
|
|
|
|
#44049 - 2003-08-14 04:14 PM
Re: RUNAS AND SENDKEYS
|
Iggy
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
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
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
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|