Using DOS command to get all the information pertaining to the sytem.
Solution:
Use of Dos coammnd: systeminfo.
Using Perl Script to get OS Name:
use strict;
system("systeminfo find \"OS Name\" > C:\\temp\\temp.txt");
open(FH, "<", "C:\\temp\\temp.txt");
my $contents = ;
my @osInfo = split(':', $contents);
$osInfo[1] = s/\s\s+//g;
print $osInfo[1];
#This script would print the OS Name. Like it would print "Microsoft Windows 7 Utlimate" if run on Windows 7 - Ultimate Version of OS.
No comments:
Post a Comment