PDA

View Full Version : Newbie needs help (W2K)



shdowflare
06-28-2002, 04:43 AM
Hello all,

I'm a complete newbie to scripting, and I'd like to learn how it will help to make my life easier at work. I've got a situation right now where I need to automate a process on a remote machine. I am sending a command via an REXEC client to an REXEC daemon on a Win2K server. The remote command has to login to a GUI-driven security dialog, then it can run its command from the CLI.

How can I populate the two fields (username/password) automatically using some type of scripting that will enter the authentication data into the GUI box?

Is this even possible? Please offer assistance if anyone knows of an easy way for a scripting newbie to accomplish such a task. Scripting examples would be very helpful!

Thanks a ton in advance!

Brian
Washington, D.C.

ywhw
07-07-2002, 06:20 AM
All I can give you, is to look into SENDKEYS... This allows you to interact with a GUI among other things.

ywhw
07-07-2002, 06:45 AM
Copy the following and save it as a .vbs file, then run it.




!!!!!!!!!!!!!!!!!!!!!below here!!!!!!!!!!!!!

set WshScript = Wscript.CreateObject("Wscript.Shell")


open_ie "www.google.com"
wshscript.sendkeys "Window Script Host"
wscript.sleep 100
wshscript.sendkeys "~"

open_ie "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsMthSendKeys.asp"




sub open_ie (dest)

wshscript.sendkeys "^{esc}"
wscript.sleep 200
wshscript.sendkeys "{up}"
wscript.sleep 200
wshscript.sendkeys "{up}"
wscript.sleep 200
wshscript.sendkeys "~"
wscript.sleep 200
wshscript.sendkeys "iexplore"
wscript.sleep 200
wshscript.sendkeys "~"
wscript.sleep 5000
wshscript.sendkeys "{Tab}"
wscript.sleep 200
wshscript.sendkeys dest
wscript.sleep 200
wshscript.sendkeys "~"
wscript.sleep 5000

end sub

!!!!!!!!!!!!!!!!!!!!above here !!!!!!!!!!!!!!!!!!!!!!!!!!!!