in reply to Dealing with timeouts using the Shell module
I don't know how much work "psinfo" does, but at least for recent service packs, I think simply checking HKEY_LOCAL_MACHINE/Software/Microsoft/Windows NT/CurrentVersion//CSDVersion in the registry is enough. And Win32::TieRegistry makes checking this on a remote computer rather easy.
I recall Windows often taking a while to decide that the connection to a remote computer was going to fail, but I think that had more to do with my strange setup and some simple testing right now shows it taking only about 4 seconds to fail for me. So, if failures usually happen that fast, then something fairly simple will work:
- tye (but my friends call me "Tye")use Win32::TieRegistry( Delimiter=>"/" ); sub get_sp { my $cpu= shift @_; my $ver= $Registry->{"//$cpu/LMachine/Software/" . "Microsoft/Windows NT/CurrentVersion//CSDVersion"}; if( ! $ver || $ver !~ /(\d+)/ ) { return "unknown"; } return $1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re: Dealing with timeouts using the Shell module
by thunders (Priest) on Jan 03, 2002 at 04:00 UTC | |
by tye (Sage) on Jan 03, 2002 at 04:42 UTC |