use Win32::OLE qw( in );
use Win32::OLE::Variant;
#Purpose to start remote process :Usage: perl filename.pl exe_to_run.exe
#thanks to Sean
our $Machine = "142.23.167.102";
our $CLASS = "WinMgmts:{impersonationLevel=impersonate}!//$Machine";
main();
sub main
{ #todo
$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,
$PROCESSSTARTUP, $vPid ) ) {
print "Process successfully created with PID $vPid\n";
}
else
{
print "Failed to create process.\n";
}
} #eof main
Getting the Current TabItem when the Tab is not selected in WPF
-
[image: Banner]
This is a quick reminder to self on how to retrieve a TabItem from a WPF
TabControl *when the tab is not currently selected* because I ru...
1 month ago
No comments:
Post a Comment
- the first minus - Comments have to be moderated because of the spammers
- the second minus - I am very lazy at moderating comments ... hardly find time ...
- the third minus - Short links are no good for security ...
- The REAL PLUS : Any critic and positive feedback is better than none, so your comments will be published sooner or later !!!!