The operator "minus" is not defined - error in relevance

I have collected the value of WindowStart from registry

Q: (value “WindowStart” of it as string) of key “HKEY_LOCAL_MACHINE\SOFTWARE\CRQ\Maintenance\Reboot” of native registry
A: 2330
T: 13777

When I tried to subtract 600 seconds from available time 2330, it’s not working ? any idea why ? or how we can do ?

Q: (value “WindowStart” of it as string) of key “HKEY_LOCAL_MACHINE\SOFTWARE\CRQ\Maintenance\Reboot” of native registry as time - 600
E: The operator “minus” is not defined.

Hello goperiya1,

You are trying to subtract an integer value from a string:

q: "2330" - 600
E: The operator "minus" is not defined.

If you convert the value taken from the registry to integer, it might work:

q: "2330" as integer - 600
A: 1730

Regards,
Vitaliy

2 Likes

Waww. Working. great . Thanks a lot Vitaliy.

You probably need to make the 600 into seconds (in parentheses) to make the subtraction

Q: 600 * second
A: 00:10:00

Like this

Q: (20 * minute) - (600 * second)
A: 00:10:00

Hi i need some help here. I’m trying to get the date (DD/MM/YYYY) where an endpoint was restarted.
For this I’m using “System Uptime”.

(day_of_month of it as two digits & “/” & month of it as two digits & “/” & year of it as string) of current date - (uptime of operating system)

But I’m reciving E: The operator “minus” is not defined.

Hope you can help me, thanks!

Joaquin

Several problems - you are trying to subtract a time from a string, which won’t work.

Even subtracting a time from a date doesn’t work either.

You can just get

boot time of operating system

but if you are on Windows, beware, because Windows only boots when you restart it (a shutdown just puts it into deep sleep and doesn’t reset the boot time)

More info on this subject here Get uptime of computer via releance