1.

Solve : VB Script for windows application?

Answer»

I would like to wow my dad for xmas and write him a script which:

1. Runs the windows remote desktop application (comes w/ vista).
2. ENTERS the ip for the remote machine.
3. Enters his user profile.
4. Enters his password.
5. Completes the connection.

I don't believe this kind of script is supposed to be difficult.
The task of doing it manually is not very difficult.
But then, I'm new to VB script. Any suggestions?

Thanks in advanceI couldn't FIND a WMI class for remote desktop, so this is not very elegant:

Code: [Select]Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "MSTSC /v:COMPUTER /w:800 /h:600 /console"
WshShell.AppActivate "Remote Desktop Connection"
WScript.Sleep 1000
WshShell.SendKeys "Signon"
WScript.Sleep 1000
WshShell.SendKeys "{tab}"
WScript.Sleep 1000
WshShell.SendKeys "Password"
WScript.Sleep 1000
WshShell.SendKeys "{enter}"

Change Computer to a real computer NAME, Signon to a real logon id and Password to a real password.

Like I said, not elegant but serviceable. I'm sure your Dad will be thrilled to get a script for Christmas.



Discussion

No Comment Found