Relevance is not showing applicable

Unsupress_forum.pdf (22.9 KB)

Script logic planned :–

It has to collect WindowStart time & WindowEnd time from windows registry and at the end of script , “WindowEnd” time has to match with system time & whenever it matches ( equals ) , it has to say “Yes”.

  • It’s checking multiple entries in the windows registry . All other values are working perfect except above logic.

Now I tried to execute where i am able to narrow down where exactly problem and it’s not coming applicable (Yes) while system reaches the “WindowEnd” time .

Attached the script for your reference .

This would be a lot simpler to help you in one forum thread, you have at least a few others open on this same topic.

I’m afraid I won’t be downloading a PDF of your script either, PDF is a common threat vector so I don’t open them. In my last response on one of your other threads I had asked for what’s actually in tge registry - do you have that available?

Yes Jason . Example as follows .

1

Just causal note :

Just I converted my code to PDF format . Not updated much in that . Doesn’t have any issue to open. However see my below code for your reference .

Code :

(if (name of operating system as lowercase does not start with “win” ) then “not managed” else (if (not exists key “HKEY_LOCAL_MACHINE\SOFTWARE\CRQ\Maintenance\Reboot” whose (exists substrings separated by “,” whose (exists (it as month) OR it as lowercase = “all”) of (value “Months” of it as string) AND exists substrings separated by “,” whose (it as integer < 5 and it as integer > 0) of (value “Week” of it as string) AND exists substrings separated by “,” whose (exists day_of_week (it)) of (value “DayAlpha” of it as string) AND conjunction of (exists time_of_day ((preceding text of it & “:” & it) of last 2 of it)) of (value “WindowStart” of it as string; value “WindowEnd” of it as string)) of native registry) then “not defined” else (if (disjunction of (((it as lowercase = “all” or it as month = current month) of item 0 of it) AND (it as integer - 1 = (current day_of_month as integer - 1) / 7) of item 1 of it AND (if (item 3 of it < item 4 of it) then (day_of_week (item 2 of it) = current day_of_week AND time of current time_of_day <= item 3 of it AND time of current time_of_day >= item 4 of it) else ((day_of_week (item 2 of it) = current day_of_week AND time of current time_of_day <= item 3 of it) OR (day_of_week (item 2 of it) + day = current day_of_week AND time of current time_of_day >= item 4 of it)))) of (substrings separated by “,” whose (exists (it as month) or it as lowercase = “all”) of (value “Months” of it as string) , substrings separated by “,” whose (exists (it as integer)) of (value “Week” of it as string) , substrings separated by “,” whose (exists day_of_week (it)) of (value “DayAlpha” of it as string) , (time_of_day ((preceding text of it & “:” & it) of last 2 of it)) of (value “WindowStart” of it as string) , (time_of_day ((preceding text of it & “:” & it) of last 2 of it)) of (value “WindowEnd” of it as string)) of key “HKEY_LOCAL_MACHINE\SOFTWARE\CRQ\Maintenance\Reboot” of native registry) AND ((((last 4 of (“0000” & ((it / 60) as string & last 2 of (“00” & ((it mod 60) as string))) of (first 2 of it as integer * 60 + last 2 of it as integer) of it) of ((value “WindowEnd” of it as string) of key “HKEY_LOCAL_MACHINE\SOFTWARE\CRQ\Maintenance\Reboot” of native registry) as string))) >= (((two digit hour of it & “” & two digit minute of it) of current time_of_day))) then “yes” else “no”)))