Hi urkec,
no, i wont use WMI, i just want to stay at Registry Information.
I solved this by writing that class, but i dont know how this will
work on vista, because i tested it only on 2000 up to XP. It works
fine, but i dont know how vista will provide the registry information:
//CODE
public class OperatingSystemEx {
private string machineName;
private Version version;
private PlatformID platformId;
public OperatingSystemEx(string TargetMachine){
this.machineName = TargetMachine;
try
{
this.platformId = PlatformID.Win32NT;
try
{
string VersionString = (string)
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMa chine,
TargetMachine).OpenSubKey(@"SOFTWARE\Microsoft\Win dows NT\CurrentVersion",
false).GetValue("CurrentVersion", "0.0");
if (VersionString != "0.0")
{
int Major = Convert.ToInt32(VersionString.Substring(0, 1));
int Minor = Convert.ToInt32(VersionString.Substring(2, 1));
this.version = new Version(Major, Minor);
}
}
catch (Exception)
{
this.version = new Version(Environment.OSVersion.VersionString);
}
}
catch (Exception)
{
this.platformId = PlatformID.Win32NT;
this.version = new Version(Environment.OSVersion.VersionString);
}
}
public System.Version Version{
get{ return this.version; }
}
public System.PlatformID Platform {
get { return this.platformId; }
}
}
//END CODE
WMI is sometimes really slow, so i wont work with it. This solution is
good, but i dont know whether it works on vista. Can you check it, if
you have vista running please and tell me what wont work if it does not,..
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space:
http://kerem-g.spaces.live.com/
Latest Open-Source Projects:
http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
"urkec" <ur***@discussions.microsoft.comschrieb im Newsbeitrag
news:05**********************************@microsof t.com...
"Kerem Gümrükcü" wrote:
>Hi,
is it possible to get the Information that comes from OperatingSystem
Class
from a Remote Comupter. Is there a remote information supporting
OperatingSystem
Class or can i get this information another way, e.g. from opening remote
registry?
The target Systems are strictly Windows.
Thanks in Advance,...
Regards
Kerem
--
-----------------------
Beste Grüsse / Best regards / Votre bien devoue
Kerem Gümrükcü
Microsoft Live Space: http://kerem-g.spaces.live.com/
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------
"This reply is provided as is, without warranty express or implied."
I think you usuallu use WMI for getting that kind of information remotely.
Have you considered Win32_OperatingSystem?
--
urkec