Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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" in front of "OS Name" and that is what I want, or at least like "Microsoft Windows 10".

Thanks

What I have tried:

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. 


Also this command from command prompt successfully copies the output to system clipboard but it doesn't work in lotus script either:

systeminfo | clip

The intention is to output this to clipboard and then capture this information from the clipboard. May be there is some access permission issue to create file or update system clipboard from lotus notes, i guess.  
Posted
Updated 3-Jan-18 19:58pm
v2

So, what did you come up with when you typed "lotusscript get windows version[^]" into Google?

The point being is you're not the first person to ask this question and it's been a solved problem for at least 20 years.
 
Share this answer
 
Comments
Member 12775034 2-Jan-18 2:01am    
I had googled many variations including the one you suggested but in vain.

This code returns "Windows/NT 6.2 "

Dim ret As Variant
ret = Evaluate(|@Platform([Specific])|)
plat$ = Join(ret, " ")
Msgbox plat$

Whereas I have windows 10 and I want like "Microsoft Windows 10 Home Single Language" or "Microsoft Windows 10".
Dave Kreskowiak 2-Jan-18 8:54am    
Sigh.

You can get it from the registry under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName.
Ok. I got it done in just 3 lines. :)

Dim Ret As Variant	
Ret =   Evaluate({ @RegQueryValue("HKEY_LOCAL_MACHINE"; "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion"; "ProductName")  })  	
Msgbox Ret(0)	'' It displays like Windows "10 Home Single Language"



Bundle of Thanks Dave.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900