Page 15 of 120

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Posted: August 4th, 2017, 12:50 pm
by jsmorley
SilverAzide wrote:Wow, you've been logged on a really long time! ;-)

If you can do me a favor, I'd appreciate it... if you still see this, can you enter the command "quser" at a command prompt and post the results? It should look something like this:

Code: Select all

USERNAME              SESSIONNAME        ID  STATE   IDLE TIME  LOGON TIME
><username>           console             1  Active      none   8/4/2017 6:29 AM
I'm wondering what your logon time date format looks like...
Don't forget that quser.exe is only available in Windows "pro" versions.

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Posted: August 4th, 2017, 12:53 pm
by SilverAzide
jsmorley wrote:Don't forget that quser.exe is only available in Windows "pro" versions.
It is? Noooooooooo!

Well, crap. Back to the drawing board then. <sigh>

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Posted: August 4th, 2017, 12:57 pm
by jsmorley
SilverAzide wrote:It is? Noooooooooo!

Well, crap. Back to the drawing board then. <sigh>
Yeah, and I have found no working alternative for it. I can find no way to get the login date and time of a "user account" that is distinct from the system boot time, other than quser.exe. All you can do is check for the version of windows, and if it is not "pro" or higher, then disable and hide the entire thing.

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Posted: August 4th, 2017, 1:16 pm
by jsmorley
Another alternative would be to watch for an error message from RunCommand, and if found, just use the system uptime for both the system and user values.

"is not recognized"

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Posted: August 4th, 2017, 1:21 pm
by SilverAzide
jsmorley wrote:Another alternative would be to watch for an error message from RunCommand, and if found, just use the system uptime for both the system and user values.
I like that idea. Trying to determine "Pro-vs.-nonPro" on everything from XP to Server 2016 could get a little gnarly.
Thanks for the suggestion! :thumbup:

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Posted: August 4th, 2017, 2:07 pm
by jsmorley
So something like this perhaps...

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
OnRefreshAction=[!CommandMeasure MeasureCheckQUSER "Run"]

[MeasureCurrentTime]
Measure=Time

[MeasureUpTime]
Measure=UpTime
Format="%4!i!d %3!i!h %2!i!m"

[MeasureGetUserName]
Measure=Plugin
Plugin=SysInfo
SysInfoType=USER_NAME
UpdateDivider=-1

[MeasureCheckQUSER]
Measure=Plugin
Plugin=RunCommand
Parameter=quser "[MeasureGetUserName]"
State=Hide
OutputType=ANSI
DynamicVariables=1
IfMatch=USERNAME
IfMatchAction=[!SetOption MeterUserLogin MeasureName "MesureParseSeconds"][!CommandMeasure MeasureUserLoginTime "Run"]
IfNotMatchAction=[!SetOption MeterUserLogin MeasureName "MeasureUpTime"]

[MeasureUserLoginTime]
Measure=Plugin
Plugin=RunCommand
Parameter=quser "[MeasureGetUserName]"
State=Hide
OutputType=ANSI
DynamicVariables=1
RegExpSubstitute=1
Substitute="(?si).*  (.*)$":"\1","#CRLF#":""
FinishAction=[!EnableMeasureGroup UserTimes]

[MeasureUserFormat]
Measure=Time
Group=UserTimes
TimeStamp=[MeasureUserLoginTime]
TimeStampFormat=%#m/%#d/%Y %#I:%M %p
Format=%a, %b %#d - %#I:%M %p
DynamicVariables=1
Disabled=1

[MeasureUserDiff]
Measure=Time
Group=UserTimes
TimeStamp=([MeasureCurrentTime:timestamp] - [MeasureUserFormat:timestamp])
DynamicVariables=1
Disabled=1

[MesureParseSeconds]
Measure=UpTime
Group=UserTimes
SecondsValue=[MeasureUserDiff:timestamp]
Format="%4!i!d %3!i!h %2!i!m"
DynamicVariables=1
Disabled=1

[MeterUpTimeText]
Meter=String
X=15
Y=2R
StringAlign=Left
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
Text=System

[MeterUpTime]
MeasureName=MeasureUpTime
Meter=String
X=154
Y=0r
StringAlign=Right
AutoScale=1
NumOfDecimals=1
FontSize=10
FontColor=255,255,255,255
AntiAlias=1

[MeterUserLoginText]
Meter=String
X=15
Y=2R
StringAlign=Left
FontSize=10
FontColor=255,255,255,255
StringCase=Proper
AntiAlias=1
DynamicVariables=1
Text=[MeasureGetUserName]

[MeterUserLogin]
Meter=String
MeasureName=MesureParseSeconds
X=154
Y=0r
StringAlign=Right
AutoScale=1
NumOfDecimals=1
FontSize=10
FontColor=255,255,255,255
AntiAlias=1
I need the initial "check" measure due to the Substitute and FinishAction on the real deal.

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Posted: August 4th, 2017, 2:24 pm
by CyberTheWorm
Got the same thing.
Capture.PNG

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Posted: August 4th, 2017, 2:28 pm
by jsmorley
CyberTheWorm wrote:Got the same thing.
Capture.PNG
This problem is different. The issue is that quser.exe is using the "locale" for the date and time format in Windows.

Yours is:
2017-07-15 03:43

Mine is:
8/4/2017 10:23 AM

This makes it a bunch harder to parse and convert to timestamps.

I'm not entirely sure this bit of information is worth the effort it will take to get right on all systems...

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Posted: August 4th, 2017, 2:37 pm
by jsmorley
http://windowsitpro.com/windows-server/jsi-tip-0311-regional-settings-registry
1.jpg
It would be complex in the extreme to get all the "International" stuff you would need from the registry, and then tailor the Substitute and TimeStampFormat options to match. I think the best bet is to just let it do its thing, based on the default US-English locale settings, and if the resulting value is an unreasonable number like >365 days, just bail out to using Uptime. I think it is pretty safe to say that you haven't been logged on for 417 years...

Re: Gadgets 3.0.0 - inspired by AddGadgets.com Sidebar Gadgets

Posted: August 4th, 2017, 2:54 pm
by 9elsen
Thanks for making these nice AddGadget monitors

I have used them since they were originally made for Windows 7 I think.

I have just loaded the latest rainmeter beta, and your latest AddGadgets.

But the Drives meter shows 100% load on all drives. I can not seem to find out how to fix this.

Is HWiNFO needed for this. Did not use that in an older version.

Have you seen this before?