VB script to run mstsc and to fill in the servername
Hi guys,
I need some help. I need to write a Vbscript that starts MSTSC and fill in the box "SERVER1" and after press OK
I made the following code:
Dim WSHShell
Set WshShell = WScript.CreateObject("WScript.Shell")
Return = WshShell.RUN ("mstsc")
WScript.Quit
But this script starts only MSTSC. So now i am looking for a code to write SERVER1 in the box.
Thanks a lot
Re: VB script to run mstsc and to fill in the servername
I wrote this code:
Return = WshShell.Run ("c:\Users\mozes\Desktop\server1.rdp")
But i am getting an error...
Re: VB script to run mstsc and to fill in the servername
Maybe:
Code:
Dim WSH
Set WSH = CreateObject("WScript.Shell")
WSH.Run "MSTSC /v:SERVER1"
or try changing the Run statement to:
Code:
WSH.Run "CMD /c MSTSC /v:SERVER1"
See http://ss64.com/nt/mstsc.html for more options.
Re: VB script to run mstsc and to fill in the servername
Quote:
Originally Posted by
His Nibbs
Maybe:
Code:
Dim WSH
Set WSH = CreateObject("WScript.Shell")
WSH.Run "MSTSC /v:SERVER1"
or try changing the Run statement to:
Code:
WSH.Run "CMD /c MSTSC /v:SERVER1"
See
http://ss64.com/nt/mstsc.html for more options.
thnaks a lot..it worked!