473,587 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(str ing machina)
{
ManagementOpera tionObserver observer = new
ManagementOpera tionObserver();
completionHandl er.MyHandler completionHandl erObj = new
completionHandl er.MyHandler();
observer.Object Ready += new
ObjectReadyEven tHandler(comple tionHandlerObj. Done);

string stringMachineNa me;
string stringCommandLi ne;
stringCommandLi ne="c:\\winnt\\ notepad.exe";
//Connect to the remote computer
ConnectionOptio ns co = new ConnectionOptio ns();
stringMachineNa me = machina;
//get user and password
if (machina!="")
{
co.Username = "aaa";
co.Password = "******";
}
//Point to machine
System.Manageme nt.ManagementSc ope ms = new
System.Manageme nt.ManagementSc ope("\\\\" + stringMachineNa me +
"\\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 = {stringCommandL ine, null, null, 0};
//Execute the method
processClass.In vokeMethod (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 11541
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.co m

"Dan Pavel" <my************ **@yahoo.com> wrote in message
news:eT******** ******@TK2MSFTN GP09.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(str ing machina)
{
ManagementOpera tionObserver observer = new
ManagementOpera tionObserver();
completionHandl er.MyHandler completionHandl erObj = new
completionHandl er.MyHandler();
observer.Object Ready += new
ObjectReadyEven tHandler(comple tionHandlerObj. Done);

string stringMachineNa me;
string stringCommandLi ne;
stringCommandLi ne="c:\\winnt\\ notepad.exe";
//Connect to the remote computer
ConnectionOptio ns co = new ConnectionOptio ns();
stringMachineNa me = machina;
//get user and password
if (machina!="")
{
co.Username = "aaa";
co.Password = "******";
}
//Point to machine
System.Manageme nt.ManagementSc ope ms = new
System.Manageme nt.ManagementSc ope("\\\\" + stringMachineNa me +
"\\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 = {stringCommandL ine, null, null, 0};
//Execute the method
processClass.In vokeMethod (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******** ******@TK2MSFTN GP09.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(str ing machina)
{
ManagementOpera tionObserver observer = new
ManagementOpera tionObserver();
completionHandl er.MyHandler completionHandl erObj = new
completionHandl er.MyHandler();
observer.Object Ready += new
ObjectReadyEven tHandler(comple tionHandlerObj. Done);

string stringMachineNa me;
string stringCommandLi ne;
stringCommandLi ne="c:\\winnt\\ notepad.exe";
//Connect to the remote computer
ConnectionOptio ns co = new ConnectionOptio ns();
stringMachineNa me = machina;
//get user and password
if (machina!="")
{
co.Username = "aaa";
co.Password = "******";
}
//Point to machine
System.Manageme nt.ManagementSc ope ms = new
System.Manageme nt.ManagementSc ope("\\\\" + stringMachineNa me +
"\\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 = {stringCommandL ine, null, null, 0};
//Execute the method
processClass.In vokeMethod (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******** ******@TK2MSFTN GP15.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
6937
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 numerous articles found Googling, this should work, but on my WinXP system, using Firefox and IE, I get nothing (when allowing pop-ups, if pop-ups are...
16
4194
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 project in debug mode (by hitting F5) it gives an error message "Error while trying to run project: Unable to start debugging on the web server.
16
21728
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 = "7" - The primary database failed to establish a connection to its standby database within the HADR timeout interval. What things should I...
1
16358
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 the user paul (pw:paul123) on the computer A in the domain ABC. This application should stop / start a service, which is running on computer B (in...
8
23421
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 = STANDARD HADR local host name (HADR_LOCAL_HOST) = testserver HADR local service name ...
6
6458
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 can see it in my task manager, but it is not visible. Can anyone explain what is happening? My code: Process p = Process.Start("IExplore.exe",...
0
1178
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 when minimized. At this point, I connect to this server using remote desktop. In the remote desktop session, I am not able to see this...
3
9452
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
1466
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 the latest patches using YaST2 - Installed Blackdown JRE, so there is a /usr/local/jdk118_v3 - directory with the correct Java - Created a soft...
0
8206
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8340
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7967
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5713
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.