Send Keys to Remote PC 
Author Message
 Send Keys to Remote PC

I am trying to launch Hotmail.com and login to hotmail on
remote machines to do some performance tests using the
code below.

Set refProcClass = GetObject("winMgmts:\\" &
strComputerName & "\root\cimv2:Win32_Process")
Call refProcClass.Create
("c:\mailtest\launchhotmail\launchhotmail.exe", Null,
Null, numprocid)

Launchhotmail.exe launches the browser wait for some time
and send the log in Keystrokes. The program works on local
PC but when attempted on remote PC, the browser is
launched but the sendkeys part fails with permission
denied error.

I guess it is some inherent security  mechanism in Win2k
stopping the sendkeys code. Any work arounds?

Thanks,

Rajesh Abraham Chacko

**********************************************************************

Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...



Fri, 29 Apr 2005 19:54:49 GMT  
 Send Keys to Remote PC
When you launch an object remotely in that manner, it creates it in a hidden
process with no display - ergo, there is nothing for sendkeys to work against.

--
Please respond in the newsgroup so everyone may benefit.
 http://dev.remotenetworktechnology.com
 ----------
 Subscribe to Microsoft's Security Bulletins:
 http://www.microsoft.com/technet/security/bulletin/notify.asp


Quote:
> I am trying to launch Hotmail.com and login to hotmail on
> remote machines to do some performance tests using the
> code below.

> Set refProcClass = GetObject("winMgmts:\\" &
> strComputerName & "\root\cimv2:Win32_Process")
> Call refProcClass.Create
> ("c:\mailtest\launchhotmail\launchhotmail.exe", Null,
> Null, numprocid)

> Launchhotmail.exe launches the browser wait for some time
> and send the log in Keystrokes. The program works on local
> PC but when attempted on remote PC, the browser is
> launched but the sendkeys part fails with permission
> denied error.

> I guess it is some inherent security  mechanism in Win2k
> stopping the sendkeys code. Any work arounds?

> Thanks,

> Rajesh Abraham Chacko

> **********************************************************************

> Comprehensive, categorised, searchable collection of links to ASP & ASP.NET

resources...


Fri, 29 Apr 2005 20:37:46 GMT  
 Send Keys to Remote PC
Hi Alex.

Thanks for the response. Since hotmail is already launched before send keys are fired, and the browser being the active window, send keys can work agnist that isn't it?

Also I am getting a permission denied message which means send keys are working but some permission issue is stopping it. I also tried to create batch file which echos a line and then fires the keystroke (this time capslock) and found that the echo statements work well on remote PC but the capslock is not happening.

Thanks,

Rajesh Abraham Chacko

**********************************************************************

Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...



Sat, 30 Apr 2005 01:57:28 GMT  
 Send Keys to Remote PC

Quote:

> Hi Alex.

> Thanks for the response. Since hotmail is already launched before
> send keys are fired, and the browser being the active window, send
> keys can work agnist that isn't it?

No, the visible desktop is associated with one "window station" (Winsta0)
and the remotely executed process runs in a completely different "window
station" that has no access to the visible desktop.

Quote:

> Also I am getting a permission denied message which means send keys
> are working but some permission issue is stopping it....

The sendkeys does *not* work - your attempt to interact with the desktop via
sendkeys is being denied.

You'd get exactly the same permission denied erropr if you remotely executed
a script that tried to do a MsgBox.  It's *exactly* the same error so many
people get trying to use MsgBox from server side ASP.

Michael Harris
Microsoft.MVP.Scripting
Seattle WA US



Sat, 30 Apr 2005 02:56:14 GMT  
 Send Keys to Remote PC
I think I now have a better Idea of what you are saying. Now is there any way to use same process or any other methods to get this accomplished.

Thanks,

Rajesh Abraham Chacko

**********************************************************************

Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...



Sat, 30 Apr 2005 12:31:48 GMT  
 Send Keys to Remote PC

Quote:

> I think I now have a better Idea of what you are saying. Now is there
> any way to use same process or any other methods to get this
> accomplished.

If the executed program requires user interaction, then it simply is *not* a
candidate for remote execution.  Remote process execution is intended for
unattended, non-interactive processes that do not depend on the presence of
an interactive user.

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US



Sat, 30 Apr 2005 22:55:57 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. connect to lan pc and send keys...

2. Help: Run app on remote pc

3. Shutdown Remote PC

4. writing vbscript to know the OS of a remote PC ( is WIndows NT or WIndows 2000)

5. Time of remote PC

6. Adding a value to the registry of a remote PC using REGOBJ.DLL

7. Start a program or process in Remote PC?

8. How do I Connect to Remote PC

9. Shutdown Remote-XP-PC from Win98-Machine

10. Deleting a Printer on Remote PC (Prnadmin.dll)

11. Time of remote PC

12. WMI connecting to a remote pc through asp.

 

 
Powered by phpBB® Forum Software