Change countdown timer based on combobox selection

Recommended Posts

Kaimberex 1

Kaimberex 1

I am in the IT department and I have been asked to create a SCCM reboot timer used when the computer requires a restart. What I am having trouble doing is changing the timer based on a combo box selection. For instance the default timer is 2 hours before the computer will be restarted. but I want to change the timer to a different value if the user selects a different time. I can get the default time to work just not stop the timer and create a new one. I am still pretty new to Autoit and could use some help. Thanks.

Share this post

Link to post

Share on other sites

ViciousXUSMC 71

ViciousXUSMC 71

This could be fun, somebody will probably beat me to it, but I would use AdlibRegister() to call my GUI with the message and restart/postpone message.

I would also have it set for a maximum of say 3 postpone attempts before it forces the reboot.

From experience the more obnoxious you make it the more prone somebody is to actually reboot else they ignore it. So I would have a GUI with the current minutes left until the next action on screen somewhere so that it nags them, and maybe a pop up message every so often to remind them they need to reboot

The way I like to do updates best is Wake on LAN all PC after hours, and do the updates with a forced reboot.

Share this post

Link to post

Share on other sites

Kaimberex 1

Kaimberex 1

we force our users to take their machines home everynight so doing them after hours only works on dekstops. most users have laptops. My manager approcahed me and asked me to improve on their current shutdown tool and I was trying to mirror the current one before adding new functionality. currently I can only get the default time of 2 hours to count down then process the restart. and If there are easier ways to do it without nagging the user id like that. the users are having the prompt come up during presentations at bord meetings and inopportune times so I will eventually add a feature to only pop up once powerpoint or webex process is not running. however I would like to at least get the core tool working first. our IT department used the Coretech Shutdown tool currently and it is missing some features and they knew I liked scripting things so I kind of agreed to see what I can do.

I hope I dont fail miserably.

Is there an easier countdown? Time functions is one thing im still trying to grasp the understanding of. so any help with example snippets is appreciated.

Share this post

Link to post

Share on other sites

Kaimberex 1

Kaimberex 1

SO i have made some modifications to get the timer to change based on cases of the dropdowns and it changes the timer. but it performs the function immediately instead of waiting for the timer to hit 00:00 I am sure I am missing something simple.

You do not need to run parameters with ShutdownTool.exe.
All Parameters are configured in config.ini.
Config.ini MUST be placed in the same folder as ShutdownTool.exe.
Admin Hotkey
Ctrl+Alt+Shift+e
There is an AdminKey hotkey to terminate the tool should a technician need to close the tool before the timer runs out. This is an administrative close function to stop the tool from executing the shutdown sequence. This is a technician only hotkey and must not be published to end users.
CONFIG.INI settings
[DefaultTimer]
This will set the timer that displays when initially launching the tool. The default timer is set to two hours. The time is set using seconds. Two hours is equal to 7200 seconds. The user will be able to postpone the timer for 10 minutes, 20 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, or 6 hours. The postponed time will be added to the initial timer.
[Custom Message]
This section displays a custom message that will be displayed on the popup.
If the computer requires a logoff instead of a reboot you must specifiy that in the message. If it requires a reboot you must specify that in the message.
[Appearance]
There are placeholders for two logos. One in the upper right hand corner and upper left hand corner. The logo files must be images in .bmp or .jpg format and cannot exceed 237x88 pixels. Place the image in the same directory as ShutdownTool.exe and config.ini
[Processes]
The tool will not launch if there are running processes that are defined in this section. There are placeholders for up to 10 processes. You must include the process name listed in task manager. For instance WINWORD.exe. Once the processes are closed the tool will pop up with the default timer.
[Logging]
This section tells the tool where the log file location will be. This must be a full path and cannot contain any spaces. The default location is C:\Windows\ShutdownTool.log.
The log entries will append to the end of the log file with date and time timestamps.
If you wish to disable Logging then make sure Logging=Disabled. If Logging=Enabled then LogDir must be specified.
[Options]
This section tells the tool what to do when the timer runs out, or when the User clicks the Restart, Shutdown, or Logoff button.
Logoff - will log the user off immediately.
Shutdown - Will shutdown the computer immediately.
Reboot - will reboot the computer if there are no active applications.
ForceReboot - will force the reboot.
ForceReboot is recommended if a reboot is required as it will not hang and the reboot will be enforced when the timer runs out.
PostponeButton - This will enable or disable the ability to postpone the timer further when the minimized notification is restored. Disallowing the user to postpone more than one time. Default vaule is disable.