-3

I'm working in Lotus script. I need to know which major version like Window XP/7/Vista/8/10 the current system's Windows OS has. As an example when I launch msinfo32 using command prompt I get Microsoft Windows 10 Home Single Language against OS Name and that is what I want, or at least "Microsoft Windows 10". Thanks

  • https://stackoverflow.com/help/how-to-ask – dda Dec 22 '17 at 05:27
  • Welcome to Stack Overflow. When you created your account here, it was suggested you take the [tour] and read the [help] pages in order to familiarize yourself with the site. Please do so before posting your next question here. Part of a minimal effort to find a solution yourself is a search for existing posts here before asking. There are many existing posts here about retrieving Windows versions, in many different programming languages. You should find several that (while not for LotusScript) should get you started in the right direction. – Ken White Dec 22 '17 at 05:30
  • Thanks for your advice. In fact I did go through the relevant questions before I posted, and of course couldn't spend enough time on it, but couldn't find doable solution in the context of lotus notes. – user1575786 Dec 22 '17 at 07:24
  • Have a look at the shell function to call some some vbs – umeli Dec 22 '17 at 07:33
  • 1
    Just google for a Visual Basic solution and take that code. It will work in LotusScript with minimal changes. – Tode Dec 22 '17 at 09:04
  • Directly using this command using command prompt, I successfuly get the result in the speicifed txt file: systeminfo > f:\\sysInfo.txt but it doesn't (seem to) execute using this code: Dim Ret As Variant Ret = Shell( "cmd systeminfo > F:\\SysInfo.txt" ) I tried this too: Ret = Shell( "systeminfo > F:\\SysInfo.txt" ) Tried this too: Dim objShell, returnValue Set objShell = CreateObject("WScript.Shell") returnValue = objShell.Run("systeminfo > f:\\sysInfo.txt", 3, False) but no luck. No error but no file is created either. – user1575786 Dec 29 '17 at 11:52

2 Answers2

0

you can get 'OS version' via formula:
@Platform([Specific])
for windows 7 you'll get something like (array)
['Windows/NT', '6.1', '', '']

or you can do just
@Platform
this will return plain os name, 'Windows/32'. BUT! it always returns /32 if you have 32-bit client/server, even if your os is 64-bit; if you have 64-bit client/server - it returns right value, i.e. always 64-bit :).

p.s. lotusscript version: :)
dim v as variant v = evaluate({ @Platform([Specific]) }) msgbox(v(0) & ", " & v(1))

p.p.s. here's windows versions list

0

Sorry for being late. Anyways, I had got it by accessing Windows Registry like this:

Dim Ret As Variant  
Ret =   Evaluate({ @RegQueryValue("HKEY_LOCAL_MACHINE"; "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"; "ProductName")  })  

Msgbox Ret(0) "displays like "Windows 10 Home Single Language"

Works fine on Windows 7, 8 as well.

Yahya Hussein
  • 8,767
  • 15
  • 58
  • 114