in reply to Re^2: VSS automation strange problem
in thread VSS automation strange problem
one end user maybe, but many other "users" too. SYSTEM, NETWORK SERVICE, LOCAL SERVICE are but a few others. Maybe this will help, i use it to identify who runs my code from a console
If you can put your process into sleep for a bit and can identify it from this list this may helpuse Win32; my $user = Win32::LoginName();
use strict; use warnings; use DBI; use DBD::WMI qw/connect prepare execute fetchrow/; use Win32::OLE qw/in/; # needs DBD::WMI # http://search.cpan.org/~corion/DBD-WMI-0.07/lib/DBD/WMI.pm # corion@cpan.org http://www.perlmonks.org/?node_id=5348 # http://www.perlmonks.org/?node_id=565819 #clues from # http://www.perlmonks.org/?node_id=821593 # https://gist.github.com/aero/1260973/6efbe8684aa54c8aecb73f601e511a5 +3bfb5c6b1 # https://msdn.microsoft.com/en-us/library/aa394388(v=vs.85).aspx # https://msdn.microsoft.com/en-us/library/aa394084(v=vs.85).aspx my $dbh = DBI->connect('dbi:WMI:'); sub do_table{ my @tables=@_; table: for my $table (@tables){ my $sth = $dbh->prepare('SELECT * FROM '.$table); unless ($sth->execute()) { print 'Unable to select from:'.$table." +\n"; next table;} print 'Table:'.$table."\n"; my $rowct=0; while (my( $row ) = $sth->fetchrow) { print ' row:'.$rowct++."\n"; foreach my $object ( in($row->{Properties_}) ) { my $outline=" $object->{Name} = "; if ( ref($object->{Value}) eq "ARRAY") { $outline.="{ "; foreach my $value ( in($object->{Value}) ) {$outline.="$va +lue ";} $outline.="}"; } else { $outline.=($object->{Value} // ""); } print $outline."\n"; } # $object } # thing } # table } # do_table do_table("Win32_Process");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: VSS automation strange problem
by huck (Prior) on Jan 04, 2017 at 01:47 UTC | |
by huck (Prior) on Jan 04, 2017 at 05:37 UTC |