欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

显示运行对话框内保存的命令历史的vbs

程序员文章站 2022-11-14 11:28:51
复制代码 代码如下:const hkey_current_user = &h80000001 strcomputer = "." set objregistry = get...
复制代码 代码如下:

const hkey_current_user = &h80000001

strcomputer = "."

set objregistry = getobject("winmgmts:\\" & strcomputer & "\root\default:stdregprov")

strkeypath = "software\microsoft\windows\currentversion\explorer\runmru"
objregistry.enumvalues hkey_current_user, strkeypath, arrvaluenames, arrvaluetypes

for each strvalue in arrvaluenames
if len(strvalue) = 1 then
objregistry.getstringvalue hkey_current_user,strkeypath,strvalue,strruncommand
intlength = len(strruncommand)
strruncommand = left(strruncommand, intlength - 2)
wscript.echo strruncommand
end if
next