|
-
Mar 12th, 2012, 07:37 AM
#1
Thread Starter
New Member
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
Last edited by Mozes; Mar 12th, 2012 at 09:52 AM.
-
Mar 12th, 2012, 09:23 AM
#2
Thread Starter
New Member
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...
-
Mar 12th, 2012, 05:29 PM
#3
Addicted Member
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.
-
Mar 13th, 2012, 02:07 AM
#4
Thread Starter
New Member
Re: VB script to run mstsc and to fill in the servername
 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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|