Unified Functional Testing (formerly QTP) News and Support Forum
Showing results for 
Search instead for 
Do you mean 

Launch Remote Machine from my desktop

Highlighted
Regular Advisor

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
10 REPLIES
Occasional Contributor

Re: Launch Remote Machine from my desktop

Try:

 

a.sendkeys "~"

 

Which is Enter, specifically.

Regular Advisor

Re: Launch Remote Machine from my desktop

Tht also didnt work, i tried it earlier
Umang Agrawal
Regular Advisor

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

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

Re: Launch Remote Machine from my desktop

 

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

Advisor

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

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

Re: Launch Remote Machine from my desktop

How to view the attachment ?

Super Advisor

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

Valued Contributor

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?