Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Making a remote process visible

Thread Tools

Making a remote process visible

Mark Elley
Posts: n/a
I am using the following code to start a process on a networked XP
machine. This all works really well but the process created is
invisible to the user (only visible in the Task Manager - Processes
tab). I need this process to be visible. I have searched for the
answers but have come to the conclusion that it is either a)
impossible or b) it is so easy that it is not documented !!!

Usage: perl exe_to_run.exe

use Win32::OLE qw( in );
use Win32::OLE::Variant;

$Machine = "";

$CLASS = "WinMgmts:{impersonationLevel=impersonate}!//$Machine";

$WMI = Win32::OLE-> GetObject( $CLASS ) || die "Unable to connect to
$Machine:" . Win32::OLE->lastError();

$PROCESSSTARTUP = $WMI-> Get("Win32_ProcessStartup")->SpawnInstance_;

$PROCESSSTARTUP-> {WinstationDesktop} = "winsta0\\default";

$PROCESSSTARTUP-> {ShowWindow} = 1;

print "$PROCESSSTARTUP-> {WinstationDesktop}\n";

$Process = $WMI-> Get( "Win32_Process" ) || die "Unable to get the
process list:" . Win32::OLE-> LastError();

$vPid = Variant( VT_I4 | VT_BYREF, 0 );

if( 0 == $Process-> Create( join( " ", @ARGV ), undef,
print "Process successfully created with PID $vPid\n";
else {
print "Failed to create process.\n";
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Input button visible when not visible tshad ASP .Net 1 10-31-2009 10:53 PM
How to make a hyperlink Visible or not visible in DataList Patrick Olurotimi Ige ASP .Net 7 06-15-2005 12:01 PM
Sections visible and not visible tshad ASP .Net 4 01-31-2005 09:30 PM
button visible/not visible tshad ASP .Net 6 10-28-2004 10:02 PM
Panel.Visible = True also make child controls visible. spamfurnace ASP .Net 1 05-24-2004 03:07 AM