显示运行对话框内保存的命令历史的vbs
发布时间:2016-12-28 来源:查字典编辑
摘要:复制代码代码如下:ConstHKEY_CURRENT_USER=&H80000001strComputer="."SetobjRegistr...
复制代码 代码如下:
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:" & strComputer & "rootdefault:StdRegProv")
strKeyPath = "SoftwareMicrosoftWindowsCurrentVersionExplorerRunMRU"
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