Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning Values From Windows

Status
Not open for further replies.

sheronne

Programmer
Jun 1, 2001
71
US
I need to return the Operation System and Network Address.
 
Let me rephrase, what are the easiest most reliable ways to return the Operating System and Network Address.
 
As for operating systm...
? OS() or ? OS(1) will get you the information.
Win2000 will return Windows 5.00 or something like that

Also ? GETENV("OS") will give you the information.
This will return Windows_NT

ALSO try
? GETENV("LOGONSERVER")
? GETENV("USERDOMAIN")
? GETENV("USERNAME")
? GETENV("USERPROFILE")
? GETENV("winbootdir")
? GETENV("WINDIR")
? GETENV("systemdrive")
? GETENV("systemroot")

Is this of any use to you ?


ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
LET KNOW IF THIS HELPED. ENOUGH EXPERTS ARE HERE TO HELP YOU OUT! BEST OF LUCK :)
 
Assuming VFP, here's a routine I use that also gives you the version info:

Code:
* GET_WINVER.PRG

Declare LONG GetVersionEx in WIN32API STRING

STORE 0 to;
   dwOSVersionInfoSize,;
   dwMajorVersion,;
   dwMinorVersion,;
   dwBuildNumber,;
   dwPlatformId
szCSDVersion = ""
PId = ""

lczStructure = chr(5*4+127+1)+replicate(chr(0), 5*4-1)+space(127)+chr(0)

lcReturn = ""
lnResult = GetVersionEx( @lczStructure )
IF lnResult <> 0	&& No Error
   dwOSVersionInfoSize = asc2BEint(lczStructure, 1, 4)
   dwMajorVersion = asc2BEint(lczStructure, 5, 4)
   dwMinorVersion = asc2BEint(lczStructure, 9, 4)
   dwBuildNumber = asc2BEint(lczStructure, 13, 4)
   dwPlatformId = asc2BEint(lczStructure, 17, 4)
   szCSDVersion = ALLTRIM(strtran(SUBSTR(lczStructure, 21),chr(0),&quot;&quot;))
   DO Case
   Case dwPlatformId = 0
      PId = &quot;32s &quot;      && &quot;Windows 32s &quot;
   Case dwPlatformId = 1
      PId = &quot;95/98 &quot;    && &quot;Windows 95/98 &quot;
   Case dwPlatformId = 2
      PId = &quot;NT &quot;       && &quot;Windows NT &quot;
   Case dwPlatformId = 3
      PId = &quot;2000 &quot;     && &quot;Windows 2000 &quot;
   ENDCASE
	
   lcReturn = PId ;
      + ALLTRIM(transform(dwMajorVersion));
      + &quot;.&quot; + ALLTRIM(transform(dwMinorVersion));
      + &quot; (Build &quot;+ ALLTRIM(transform(dwBuildNumber));
      + &quot;: &quot;+ szCSDVersion;
      + &quot;)&quot;
ENDIF

RETURN lcReturn

What do you mean by the Network Address? TCP/IP address? NIC? What kind of network?

Rick

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top