use Win32::OLE qw(in);
my $datetime = Win32::OLE->new("WbemScripting.SWbemDateTime") or die ;
my $machine = shift @ARGV or ".";
$machine =~ s/^[\\\/]+//;
my $wmiservices = Win32::OLE->GetObject("winmgmts:{impersonationLevel=impersonate,(security)}//$machine") or die ;
foreach my $os ( in( $wmiservices->InstancesOf("Win32_OperatingSystem")))
{
print "Last Boot Time:".$os->{LastBootUpTime}."\n";
print "Current time:".$os->{LocalDateTime}."\n";
$datetime->{Value} = $os->{LocalDateTime};
printf( "Current Time: %02d-%02d-%04d at %02d:%02d:%02d\n", $datetime->{Month}, $datetime->{Day}, $datetime->{Year}, $datetime->{Hours}, $datetime->{Minutes}, $datetime->{Seconds} );
print "Setting time + 2 hours:";
$datetime->{Hours} += 2;
printf( "Current Time: %02d-%02d-%04d at %02d:%02d:%02d\n", $datetime->{Month}, $datetime->{Day}, $datetime->{Year}, $datetime->{Hours}, $datetime->{Minutes}, $datetime->{Seconds} );
print "\tHard value: $datetime->{Value}\n";
$Result = $os->SetDateTime($datetime->{Value});
print "Result: $Result\n";
}
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 !!!!