473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Start remote app visible

Hi, I am starting a new process (Notepad) on a remote machine but it is
not visible. When I start it on my machine it is visible. What I am
doing wrong ?

private void run_notepad(string machina)
{
ManagementOperationObserver observer = new
ManagementOperationObserver();
completionHandler.MyHandler completionHandlerObj = new
completionHandler.MyHandler();
observer.ObjectReady += new
ObjectReadyEventHandler(completionHandlerObj.Done) ;

string stringMachineName;
string stringCommandLine;
stringCommandLine="c:\\winnt\\notepad.exe";
//Connect to the remote computer
ConnectionOptions co = new ConnectionOptions();
stringMachineName = machina;
//get user and password
if (machina!="")
{
co.Username = "aaa";
co.Password = "******";
}
//Point to machine
System.Management.ManagementScope ms = new
System.Management.ManagementScope("\\\\" + stringMachineName +
"\\root\\cimv2", co);
//get process path
ManagementPath path = new ManagementPath( "Win32_Process");
//Get the object on which the method will be invoked
ManagementClass processClass = new ManagementClass(ms,path,null);
//Create an array containing all arguments for the method
object[] methodArgs = {stringCommandLine, null, null, 0};
//Execute the method
processClass.InvokeMethod (observer, "Create", methodArgs);
Thank you
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #1
5 11523
Dan,

My guess is that when you run notepad on the other machine, it is
running in a different desktop session, and not the session that you are
logged into.

You would have to find some way to access that desktop session, and make
the process show up in that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dan Pavel" <my**************@yahoo.com> wrote in message
news:eT**************@TK2MSFTNGP09.phx.gbl...
Hi, I am starting a new process (Notepad) on a remote machine but it is
not visible. When I start it on my machine it is visible. What I am
doing wrong ?

private void run_notepad(string machina)
{
ManagementOperationObserver observer = new
ManagementOperationObserver();
completionHandler.MyHandler completionHandlerObj = new
completionHandler.MyHandler();
observer.ObjectReady += new
ObjectReadyEventHandler(completionHandlerObj.Done) ;

string stringMachineName;
string stringCommandLine;
stringCommandLine="c:\\winnt\\notepad.exe";
//Connect to the remote computer
ConnectionOptions co = new ConnectionOptions();
stringMachineName = machina;
//get user and password
if (machina!="")
{
co.Username = "aaa";
co.Password = "******";
}
//Point to machine
System.Management.ManagementScope ms = new
System.Management.ManagementScope("\\\\" + stringMachineName +
"\\root\\cimv2", co);
//get process path
ManagementPath path = new ManagementPath( "Win32_Process");
//Get the object on which the method will be invoked
ManagementClass processClass = new ManagementClass(ms,path,null);
//Create an array containing all arguments for the method
object[] methodArgs = {stringCommandLine, null, null, 0};
//Execute the method
processClass.InvokeMethod (observer, "Create", methodArgs);
Thank you
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #2

"Dan Pavel" <my**************@yahoo.com> wrote in message
news:eT**************@TK2MSFTNGP09.phx.gbl...
Hi, I am starting a new process (Notepad) on a remote machine but it is
not visible. When I start it on my machine it is visible. What I am
doing wrong ?

private void run_notepad(string machina)
{
ManagementOperationObserver observer = new
ManagementOperationObserver();
completionHandler.MyHandler completionHandlerObj = new
completionHandler.MyHandler();
observer.ObjectReady += new
ObjectReadyEventHandler(completionHandlerObj.Done) ;

string stringMachineName;
string stringCommandLine;
stringCommandLine="c:\\winnt\\notepad.exe";
//Connect to the remote computer
ConnectionOptions co = new ConnectionOptions();
stringMachineName = machina;
//get user and password
if (machina!="")
{
co.Username = "aaa";
co.Password = "******";
}
//Point to machine
System.Management.ManagementScope ms = new
System.Management.ManagementScope("\\\\" + stringMachineName +
"\\root\\cimv2", co);
//get process path
ManagementPath path = new ManagementPath( "Win32_Process");
//Get the object on which the method will be invoked
ManagementClass processClass = new ManagementClass(ms,path,null);
//Create an array containing all arguments for the method
object[] methodArgs = {stringCommandLine, null, null, 0};
//Execute the method
processClass.InvokeMethod (observer, "Create", methodArgs);
Thank you
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


You can't do this. The security system in windows does not allow WMI to
lauch a program that accesses the interactive desktop (if any). I'm not
clear on why you would run a program with his UI on a remote server?

Willy.
Nov 17 '05 #3
Hi, I am trying to uninstall an application remotely. I made an
application who use the uninstall string from the registry of the remote
computer and run it. I used the notepad only to test how can I run a app
remotely on the screen. What I really want to know is if I start the
uninstall how can I pass the confirmation steps (next, finish buttons
for e.g.)

Thank you

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #4
You can always write a server application then your client could call
that server then the server would execute whatever you want. Since the
server run in the current user session then it should show up on the
screen.

On Wed, 23 Mar 2005 03:34:32 -0800, Dan Pavel
<my**************@yahoo.com> wrote:
Hi, I am trying to uninstall an application remotely. I made an
application who use the uninstall string from the registry of the remote
computer and run it. I used the notepad only to test how can I run a app
remotely on the screen. What I really want to know is if I start the
uninstall how can I pass the confirmation steps (next, finish buttons
for e.g.)

Thank you

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 17 '05 #5


"Dan Pavel" <my**************@yahoo.com> wrote in message
news:uh**************@TK2MSFTNGP15.phx.gbl...
Hi, I am trying to uninstall an application remotely. I made an
application who use the uninstall string from the registry of the remote
computer and run it. I used the notepad only to test how can I run a app
remotely on the screen. What I really want to know is if I start the
uninstall how can I pass the confirmation steps (next, finish buttons
for e.g.)

Thank you

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Why not use sysinternals psexec tool for this? This tool executes a command
on a remote box while redirecting the UI to the client.

http://www.sysinternals.com/ntw2k/fr.../pstools.shtml

Willy.
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: GEL | last post by:
Hi, I want to open a new browser window, let the user use that window for several minutes, and when they close, I'd like to change the page displayed in the original window. According to...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
16
by: gumby | last post by:
I'm having trouble getting HADR to work with the sample databases on two HS20 xSeries blades, Red Hat ES4 up3, DB2 8.2.4, getting the following error. SQL1768N Unable to start HADR. Reason code...
1
by: schaf | last post by:
Hi all! I'm still trying to start/stop a service on a remote computer. (I promiss that's the last new post because of this problem from my side) My situation: I've an application running under...
8
by: Challenge | last post by:
Hi, I got error, SQL1768N Unable to start HADR. Reason code = "7", when I tried to start hadr primary database. Here are the hadr configuration of my primary db: HADR database role ...
6
by: uuyytt | last post by:
I have a Windows service from which I want to start Internet Explorer with a particular URL as an argument. I don't know why my code (shown below) doesn't work. I know that IExplore.exe starts as I...
0
by: Mani | last post by:
Hi All, I have a terminal server running in Windows 2000. I have an MFC application "A.exe" developed in VC++ 2005, which runs in this machine. This application shows a tray icon in the task bar...
3
by: Billy Bob | last post by:
Hello In C# how can i start a remote process such as someapp.exe on a remote PC? I know the remote PC's name, but how do I start the app on that PC? Thanks ..
2
by: ketil V. | last post by:
I am trying to install Oracle 8.1.7-3 on a clean SuSE 8.2 - based system, but the Installer will not pop up any interface! What I have done is the following: - Installed 8.2, and upgraded with...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.