can you tell me how I can display the output from a .vbs file in Rainmeter?
Here is the .vbs i want to display:
Code: Select all
'==========================================================================
'
' NAME: PasswordExpares.vbs
'
' AUTHOR: Michael Blizniuk
' DATE : 02.04.2016
' V.1.1
'
' COMMENT:
' Get User Password expares date
'
'==========================================================================
ON Error Resume Next
Const SEC_IN_DAY = 86400
Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000
Const HKEY_CURRENT_USER = &H80000001
Const HKEY_LOCAL_MACHINE = &H80000002
Const NeverExp = "Never"
Const NoInfo = "No Info"
Const strComputer = "."
' Const Savekey = "Identities"
Const Savekey = ""
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
Set objUser = Createobject("ADSystemInfo")
Set CurrentUser = GetObject("LDAP://" & objUser.UserName)
intCurrentValue = CurrentUser.userAccountControl
If intCurrentValue = 0 Then
oReg.GetDWORDValue HKEY_CURRENT_USER,Savekey,"DELuserAccountControl",intCurrentValue
If intCurrentValue =0 Then
PasswordExpares = NoInfo
Else
If intCurrentValue And ADS_UF_DONT_EXPIRE_PASSWD Then
PasswordExpares = NeverExp
Else
oReg.GetStringValue HKEY_CURRENT_USER,Savekey,"DELMaxPasswordAge",StrValue
intMaxPwdAge=CDbl( StrValue)
If intMaxPwdAge < 0 and Now > PolycyStartDate Then
PasswordExpares = NeverExp
Else
oReg.GetStringValue HKEY_CURRENT_USER,Savekey,"DELPasswordLastChanged",StrValue
dtmValue=cdate(StrValue)
intMaxPwdAge = (intMaxPwdAge/SEC_IN_DAY)
' PasswordExpares = FormatDateTime(cdate(dtmValue + intMaxPwdAge),2) & " " & Replace(FormatDateTime(dtmValue,4), "0", "",1, 1, 1)
PasswordExpares = FormatDateTime(cdate(dtmValue + intMaxPwdAge),2) & " " & _
Replace(left(FormatDateTime(dtmValue,4) ,1), "0", "",1, 1, 1) & _
Right(FormatDateTime(dtmValue,4),4)
End If
End if
End if
Else
oReg.SetDWORDValue HKEY_CURRENT_USER,Savekey,"DELuserAccountControl",intCurrentValue
If intCurrentValue and ADS_UF_DONT_EXPIRE_PASSWD Then
PasswordExpares = NeverExp
Else
dtmValue = CurrentUser.PasswordLastChanged
oReg.SetStringValue HKEY_CURRENT_USER,Savekey,"DELPasswordLastChanged",cSTR(dtmValue)
' oReg.GetStringValue HKEY_CURRENT_USER,"Volatile Environment","USERDOMAIN",Domain
Set objDomainNT = GetObject("WinNT://" & objUser.DomainShortName)
intMaxPwdAge = objDomainNT.Get("MaxPasswordAge")
intMaxPwdAge = 5184000
oReg.SetStringValue HKEY_CURRENT_USER,Savekey,"DELMaxPasswordAge",cstr(intMaxPwdAge)
If intMaxPwdAge < 0 Then
PasswordExpares = NeverExp
Else
intMaxPwdAge = (intMaxPwdAge/SEC_IN_DAY)
'PasswordExpares = FormatDateTime(dtmValue + intMaxPwdAge,2) & " " & Replace(FormatDateTime(dtmValue + intMaxPwdAge,4), "0", "",1, 1, 1)
PasswordExpares = FormatDateTime(dtmValue + intMaxPwdAge,2) & " " & _
Replace(left(FormatDateTime(dtmValue + intMaxPwdAge,4) ,1), "0", "",1, 1, 1) & _
Right(FormatDateTime(dtmValue + intMaxPwdAge,4),4)
End If
End If
End If
Echo PasswordExpares