I've browsed page after page after page of data on the web and everyone seems to say that you cannot have an executable remotely execute an application on another machine via WMI and have the window of that application display.
Does anyone know a way around this?
I have tried created 2 executables. 1 executable uses the Process class and simply starts an executable. Here's the code:
class Program
{
static void Main( string[ ] args )
{
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.CreateNoWindow = false;
startInfo.UseShellExecute = false;
startInfo.FileName = "C:\\folder\\Mexe.exe";
startInfo.WindowStyle = ProcessWindowStyle.Normal;
//p.MachineName="server";
//p.Start(startInfo);
Process p = Process.Start( startInfo );
}
}
This executable resides on the remote machine.
I have another executable that will be on the client's machine. This exe uses WMI in C# to remotely execute the application on the server via the commandline. I get a return code of 0. Nothing happens on the server.
Any ideas what I might be doing wrong?
I've also thought about creating a scheduled task in task scheduler on the server, but leaving the task disabled.
Anyone have an idea what the C# code would be to have a WMI application kick off this task? Would there be a way to discern whether the task/application started finished?