如何使用lotusscript获取完整的Windows版本信息(Windows XP / 7)? [英] How to get complete windows version information (windows XP/7) using lotusscript?

查看:118
本文介绍了如何使用lotusscript获取完整的Windows版本信息(Windows XP / 7)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Lotus脚本中工作。我需要知道当前系统的Windows操作系统有哪些主要版本如Window XP / 7 / Vista / 8/10。作为一个例子,当我使用命令提示符启动msinfo32时,我在操作系统名称前面得到Microsoft Windows 10 Home Single Language,这就是我想要的,或者至少像Microsoft Windows 10。



谢谢



我的尝试:



使用命令提示符直接使用此命令,我成功地在特定的txt文件中获得结果:

systeminfo> f:\\sysInfo.txt

但它没有(似乎)使用此代码执行:

Dim Ret As Variant
Ret = Shell (cmd systeminfo> F:\\SysInfo.txt)

我也试过这个:

Ret = Shell(systeminfo> F:\ \ SysInfo.txt)

也试过这个:

Dim objShell,returnValue
设置objShell = CreateObject(WScript.Shell)
returnValue = objShell.Run(systeminfo> f:\\sysInfo.txt,3,False)


但没有运气。没有错误,但也没有创建文件。


此命令从命令提示符成功将输出复制到系统剪贴板,但它在Lotus脚本中也不起作用:

systeminfo | clip

目的是将其输出到剪贴板,然后从剪贴板中捕获此信息。可能有一些访问权限问题,从Lotus notes创建文件或更新系统剪贴板,我想。

解决方案

那么,当您输入 lotusscript get windows version [ ^ ]进入谷歌?



关键在于你再不是第一个问这个问题,它是一个解决的问题至少20年。
确定。我只用了3行完成了它。 :)



 Dim Ret As Variant 
Ret = Evaluate({@RegQueryValue(HKEY_LOCAL_MACHINE;SOFTWARE \\ Microsoft \\ Windows NT \\ CurrentVersion;ProductName)})
Msgbox Ret(0)''显示如Windows10 Home Single Language







捆绑谢谢戴夫。


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.  

解决方案

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.


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.


这篇关于如何使用lotusscript获取完整的Windows版本信息(Windows XP / 7)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆