_install_win_taskscheduler: zero-pad the minute in the schtasks /ST value (#4950)

This commit is contained in:
neil committed 2026-07-05 17:13:24 +08:00
1 parent 934711e51d
commit e964157bff
1 file changed
+4 -2
+4 -2
View File
@@ -6658,8 +6658,10 @@ _install_win_taskscheduler() {
_info "$PROJECT_NAME will not save your password." _info "$PROJECT_NAME will not save your password."
_info "Please input your Windows password for: $(__green "$_myname")" _info "Please input your Windows password for: $(__green "$_myname")"
_password="$(__read_password)" _password="$(__read_password)"
#SCHTASKS.exe '/create' '/SC' 'DAILY' '/TN' "$_WINDOWS_SCHEDULER_NAME" '/F' '/ST' "00:$_randomminute" '/RU' "$_myname" '/RP' "$_password" '/TR' "$_winbash -l -c '$_lesh --cron --home \"$LE_WORKING_DIR\" $_centry'" >/dev/null #schtasks.exe /ST requires the HH:mm format, so the minute must be zero-padded (issue 4950)
echo SCHTASKS.exe '/create' '/SC' 'DAILY' '/TN' "$_WINDOWS_SCHEDULER_NAME" '/F' '/ST' "00:$_randomminute" '/RU' "$_myname" '/RP' "$_password" '/TR' "\"$_winbash -l -c '$_lesh --cron --home \"$LE_WORKING_DIR\" $_centry'\"" | cmd.exe >/dev/null _st_minute="$(printf "%02d" "$_randomminute")"
#SCHTASKS.exe '/create' '/SC' 'DAILY' '/TN' "$_WINDOWS_SCHEDULER_NAME" '/F' '/ST' "00:$_st_minute" '/RU' "$_myname" '/RP' "$_password" '/TR' "$_winbash -l -c '$_lesh --cron --home \"$LE_WORKING_DIR\" $_centry'" >/dev/null
echo SCHTASKS.exe '/create' '/SC' 'DAILY' '/TN' "$_WINDOWS_SCHEDULER_NAME" '/F' '/ST' "00:$_st_minute" '/RU' "$_myname" '/RP' "$_password" '/TR' "\"$_winbash -l -c '$_lesh --cron --home \"$LE_WORKING_DIR\" $_centry'\"" | cmd.exe >/dev/null
echo echo
} }
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.