Launch Remote Machine from my desktop (512 Views)
Reply
Regular Advisor
Umang_Agrawal
Posts: 83
Registered: ‎04-30-2008
Message 1 of 11 (512 Views)

Launch Remote Machine from my desktop

Hi All,

 

I have to launch Remote Machine from my desktop. i am using the below code which launches the server

 

(i have saved username and password in mstsc file)

set a = wscript.CreateObject("WScript.Shell")
a.Run "mstsc /v:server_name"

 

But just before the launch a warning message stating "you are accessing a system in company network, if you are authorized click on OK"

 

i tried below code to sendkeys space bar / enter, but it is not working.

a.sendkeys " "

 

on Manually clicking on OK remote machine gets launched. please help

Umang Agrawal
Occasional Contributor
bhandley
Posts: 6
Registered: ‎03-26-2013
Message 2 of 11 (497 Views)

Re: Launch Remote Machine from my desktop

Try:

 

a.sendkeys "~"

 

Which is Enter, specifically.

Regular Advisor
Umang_Agrawal
Posts: 83
Registered: ‎04-30-2008
Message 3 of 11 (489 Views)

Re: Launch Remote Machine from my desktop

Tht also didnt work, i tried it earlier
Umang Agrawal
Regular Advisor
Ryoganat1
Posts: 90
Registered: ‎10-04-2012
Message 4 of 11 (466 Views)

Re: Launch Remote Machine from my desktop

1. Did you try save it as with .RDP file and launch.

 

2.  Type mstsc /? in the command prompt and you will all the switch options. Try with /Public.

 

Thanks,

Ram

Regular Advisor
Umang_Agrawal
Posts: 83
Registered: ‎04-30-2008
Message 5 of 11 (463 Views)

Re: Launch Remote Machine from my desktop

This is also not working.

 

Actually by my method i am able to launch MSTSC, but before it launch remote machine, i am getting a warning message. Now i want to know how to click on OK to proceed further.


Ryoganat1 wrote:

1. Did you try save it as with .RDP file and launch.

 

2.  Type mstsc /? in the command prompt and you will all the switch options. Try with /Public.

 

Thanks,

Ram


 

Umang Agrawal
Regular Advisor
Ryoganat1
Posts: 90
Registered: ‎10-04-2012
Message 6 of 11 (453 Views)

Re: Launch Remote Machine from my desktop

 

Can to attach the snapshot of the message? So that we can narrow down the solution.

Advisor
Deepak111
Posts: 22
Registered: ‎02-15-2013
Message 7 of 11 (446 Views)

Re: Launch Remote Machine from my desktop

May be you can try programming the button control something similar like below:

 

Set Desc=Description.Create()
Desc("micclass").Value="vbButton"
Dim Button


Set Button=Window("ForeGround:=True").ChildObjects(Desc)

 

Button.click

 

The classname "vbButton" will change depending on the window it is appearing. Use Object Spy to check the class name.

 

 

Regular Advisor
Umang_Agrawal
Posts: 83
Registered: ‎04-30-2008
Message 8 of 11 (443 Views)

Re: Launch Remote Machine from my desktop

Thanks dude, i was looking for something in pure vbscript.

 

attached is the image of remote machine along with teh dialog in it.

Umang Agrawal
Advisor
Deepak111
Posts: 22
Registered: ‎02-15-2013
Message 9 of 11 (433 Views)

Re: Launch Remote Machine from my desktop

How to view the attachment ?

Super Advisor
csm2mk
Posts: 216
Registered: ‎02-08-2013
Message 10 of 11 (425 Views)

Re: Launch Remote Machine from my desktop

Try to connect as an admin.

 

It will only work if you are really an admin in the remote machine obviously.

 

mstsc /admin

Regular Advisor
HaiTNguyen
Posts: 105
Registered: ‎11-29-2011
Message 11 of 11 (401 Views)

Re: Launch Remote Machine from my desktop

AFAIK, you cannot do anything on RDP screen using QTP. You have to look for another option.

Does that machine have display output? Can you use VNC instead?
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.