Found a relevant registry entry:
[HKEY_USERS\.DEFAULT\Control Panel\International]
"sShortDate"="yyyy-MM-dd"
So for a complete solution I need to add:
1. code to read that on the local computer:
RegRead, dateformat, HKEY_USERS, .DEFAULT\Control Panel\International, sShortDate
2. modify the script based on the format there. There might be a lot of different such formats so it is hard to cover them all.
Here's a non-complete quick fix that at least might satisfy Canadians, Swedes and Germans (as a rule, world domination is best achieved incrementally )But sometimes, just sometimes, it can be had straight away,
muaHAHAHAHA :
;-- Fast Shutdown -- by Nod5
;-- v090510b
;-- does a onestep windows shutdown unless there are scheduled tasks later the same day
;-- default hotkeys: (middle click on Start button) OR (Right Shift + Escape)
#singleinstance, force
~Mbutton::
MouseGetPos,,,xxid, xxcontr
WinGetClass, xxstart, ahk_id %xxid%
if xxstart = Shell_TrayWnd ;-- if mouse over start button
if xxcontr = Button1
goto fastshutdown
return
RShift & Esc::
fastshutdown:
xout =
xvar =
x = %A_Temp%\%A_now%.txt
RunWait %comspec% /c "schtasks > "%x%"",,Hide
FileRead, xvar, %x%
FileDelete, %x%
FormatTime, today, A_Now, ShortDate
Loop, Parse, xvar, `n, `r
{
if A_LoopField contains %today%
xout = %xout%`n%A_Loopfield%
}
if xout !=
{
MsgBox, 1, Fast Shutdown, %xout%`n`nReally shutdown?
IfMsgBox, OK
Shutdown, 1
}
else
{
MsgBox, 1, Fast Shutdown, Shutdown in 5 seconds...,5
IfMsgBox, OK
Shutdown, 1
IfMsgbox, Timeout
Shutdown, 1
}
return
(FormatTime in Autohotkey had a ShortDate option)