[hotkeys:]
left-click (or right-click) Start button: shutdown options
Win+R: Run dialog
Win+L: lock workstation
Ctrl+Alt+arrow: rotate the screen
Ctrl+Shift+Esc (or Ctrl+Alt+Del): Windows Task Manager
[Run dialog: strings to type:]
control hotplug.dll: Safely Remove Hardware
msinfo32: System Information
notepad: Notepad
sndvol (or sndvol32): Volume Mixer/Volume Control
see also: MORE TIPS section, lower down
==================================================
GET/SET FOLDER/FOCUS/SELECTION, CREATE NEW FILE/FOLDER:
Explorer folder windows/Desktop, file/folder interaction - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=35041
Select a file by name:
Code: Select all
#IfWinActive ahk_class CabinetWClass
q:: ;explorer - select file by name
#IfWinActive ahk_class ExploreWClass
q:: ;explorer - select file by name
;where vName can be a name or path
vName := "New Text Document.txt"
;vName := A_Desktop "\New Text Document.txt"
WinGet, hWnd, ID, A
for oWin in ComObjCreate("Shell.Application").Windows
{
if (oWin.HWND = hWnd)
{
;SVSI_FOCUSED := 0x10 ;SVSI_ENSUREVISIBLE := 0x8
;SVSI_DESELECTOTHERS := 0x4 ;SVSI_EDIT := 0x3
;SVSI_SELECT := 0x1 ;SVSI_DESELECT := 0x0
oItems := oWin.Document.Folder.Items
try oWin.Document.SelectItem(vName, 0x1D)
break
}
}
oWin := ""
return
#IfWinActive
Code: Select all
#IfWinActive ahk_class CabinetWClass
q:: ;explorer - create new text file and focus/select it
#IfWinActive ahk_class ExploreWClass
q:: ;explorer - create new text file and focus/select it
;note: similar to: right-click, New, Text Document
vNameNoExt := "New Text Document"
vDotExt := ".txt"
WinGet, hWnd, ID, A
for oWin in ComObjCreate("Shell.Application").Windows
{
if (oWin.HWND = hWnd)
{
vDir := RTrim(oWin.Document.Folder.Self.Path, "\")
;if !DirExist(vDir)
if !InStr(FileExist(vDir), "D")
{
oWin := ""
return
}
Loop
{
vSfx := (A_Index=1) ? "" : " (" A_Index ")"
vName := vNameNoExt vSfx vDotExt
vPath := vDir "\" vName
if !FileExist(vPath)
break
}
;create a blank text file (ANSI/UTF-8/UTF-16)
;FileAppend,, % "*" vPath
FileAppend,, % "*" vPath, UTF-8
;FileAppend,, % "*" vPath, UTF-16
;SVSI_FOCUSED := 0x10 ;SVSI_ENSUREVISIBLE := 0x8
;SVSI_DESELECTOTHERS := 0x4 ;SVSI_EDIT := 0x3
;SVSI_SELECT := 0x1 ;SVSI_DESELECT := 0x0
Loop 30
{
if !(oWin.Document.Folder.Items.Item(vName).path = "")
{
oWin.Document.SelectItem(vPath, 0x1F)
break
}
Sleep, 100
}
break
}
}
oWin := ""
return
#IfWinActive
Navigate an Explorer object to a CLSID address - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=5592
Use a hotkey, e.g. Shift+Enter, to open a file/folder with a secondary program:
Quicker way to open script file for editing - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=26638
==================================================
PROCESS INFO
Code: Select all
q:: ;active process - get all info
WinGet, vPID, PID, A
oProcInfo := {}
for oProc in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process where ProcessId = " vPID)
{
for oProp in ComObjGet("winmgmts:\\.\root\CIMV2:Win32_Process").Properties_
vOutput .= oProp.Name "`t" oProc[oProp.Name] "`r`n"
}
oProc := oProp := ""
Clipboard := vOutput
MsgBox, % "done"
return
w:: ;all processes - get creation date (UTC)
oProcInfo := {}
for oProc in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process")
vOutput .= SubStr(oProc.CreationDate, 1, 14) "`t" oProc.Name "`r`n"
oProc := ""
Clipboard := vOutput
MsgBox, % "done"
return
e:: ;notepad processes - get creation date (UTC), PID, window title
oProcInfo := {}
vPName := "notepad.exe"
for oProc in ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process where Name='" vPName "'")
{
WinGetTitle, vWinTitle, % "ahk_class Notepad ahk_pid " oProc.ProcessID
vOutput .= SubStr(oProc.CreationDate, 1, 14) "`t" oProc.ProcessID "`t" vWinTitle "`r`n"
}
oProc := ""
Clipboard := vOutput
MsgBox, % "done"
return
r:: ;processes with names containing 'pad' - get PID and name
;IWbemServices::ExecQuery (wbemcli.h) | Microsoft Docs
;https://docs.microsoft.com/en-us/windows/win32/api/wbemcli/nf-wbemcli-iwbemservices-execquery
;Querying with WQL - Windows applications | Microsoft Docs
;https://docs.microsoft.com/en-gb/windows/win32/wmisdk/querying-with-wql
for oProc in ComObjGet("winmgmts:").ExecQuery("SELECT * FROM Win32_Process WHERE Name LIKE '%pad%'")
MsgBox, % oProc.ProcessID "`t" oProc.Name
oProc := ""
return
SPECIAL FOLDERS:
Code: Select all
;Run, ::{20d04fe0-3aea-1069-a2d8-08002b30309d} ;Computer (My Computer)
;Run, ::{645ff040-5081-101b-9f08-00aa002f954e} ;Recycle Bin
;Run, shell:MyComputerFolder ;Computer (My Computer)
;Run, shell:RecycleBinFolder ;Recycle Bin
Code: Select all
;Tested on Windows 7.
;combined A_Desktop and A_DesktopCommon
Run, "%A_Desktop%"
;Run, "C:\Users\%A_UserName%\Desktop"
;Run, explore "%A_Desktop%"
;Run, shell:Desktop
;A_Desktop only
Run, explorer.exe "%A_Desktop%"
;Run, explorer.exe "C:\Users\%A_UserName%\Desktop"
;Run, "C:\Documents and Settings\%A_UserName%\Desktop"
;A_DesktopCommon only
Run, "%A_DesktopCommon%"
;Run, C:\Users\Public\Desktop
Code: Select all
;PostMessage, 0x111, 415,,, ahk_class Shell_TrayWnd ;WM_COMMAND ;Win+M?
;PostMessage, 0x111, 416,,, ahk_class Shell_TrayWnd ;WM_COMMAND ;Shift+Win+M? restore all
;PostMessage, 0x111, 419,,, ahk_class Shell_TrayWnd ;WM_COMMAND ;show desktop (doesn't toggle)
;PostMessage, 0x111, 407,,, ahk_class Shell_TrayWnd ;WM_COMMAND ;Win+D? show desktop toggle
[disable Win+L hotkey][define alternative hotkey]
locking my screen not with Win L - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=69537
WINDOWS / DIALOG BOXES:
Code: Select all
;PostMessage, 0x111, 401,,, ahk_class Shell_TrayWnd ;WM_COMMAND ;Win+R Run dialog
;Run, shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0} ;Win+R Run dialog
;PostMessage, 0x111, 41093,,, ahk_class Shell_TrayWnd ;WM_COMMAND ;Win+F Search Results
;Run, taskmgr ;Ctrl+Shift+Esc Windows Task Manager
;Run, control hotplug.dll ;Safely Remove Hardware (e.g. Windows XP)
;Run, sndvol32 ;Volume Control (e.g. Windows XP)
;Run, sndvol ;Volume Mixer (e.g. Windows 7)
;Run, C:\Windows\System32\SndVol.exe ;Volume Mixer (e.g. Windows 7)
;Run, msinfo32 ;System Information
;Run, intl.cpl ;Region and Language
;Run, timedate.cpl ;Date and Time
;Run, sysdm.cpl ;System Properties, Computer Name tab
;Run, % "control sysdm.cpl,,2" ;System Properties, Hardware tab ;tab may not show
;Run, % "control sysdm.cpl,,3" ;System Properties, Advanced tab ;(e.g. Environment Variables)
;Run, % "control sysdm.cpl,,3" ;System Properties, Advanced tab ;(e.g. Performance, Settings..., Adjust for best performance)
;Run, % "control sysdm.cpl,,4" ;System Properties, System Protection tab ;tab may not show
;Run, % "control sysdm.cpl,,5" ;System Properties, Remote tab
;Run, mmsys.cpl ;Sound, Playback tab
;Run, % "control mmsys.cpl,,1" ;Sound, Recording tab
;Run, % "control mmsys.cpl,,2" ;Sound, Sounds tab
;Run, % "control mmsys.cpl,,3" ;Sound, Communications tab
;Run, % "rundll32 shell32.dll,Options_RunDLL" ;Folder Options, General tab
;Run, % "rundll32 shell32.dll,Options_RunDLL 7" ;Folder Options, View tab
;Run, % "rundll32 shell32.dll,Options_RunDLL 2" ;Folder Options, Search tab
;Run, % "rundll32 shell32.dll,Options_RunDLL 1" ;Taskbar and Start Menu Properties, Taskbar tab
;Run, % "rundll32 shell32.dll,Options_RunDLL 3" ;Taskbar and Start Menu Properties, Start Menu tab
;Run, % "rundll32 shell32.dll,Options_RunDLL 6" ;Taskbar and Start Menu Properties, Toolbars tab
;Run, % "rundll32 shell32.dll,Options_RunDLL 5" ;Control Panel\All Control Panel Items\Notification Area Icons
;Run, % "rundll32 shell32.dll,Options_RunDLL 4" ;Control Panel\All Control Panel Items\Notification Area Icons\System Icons
;e.g. DllCall equivalents:
;DllCall("shell32\Options_RunDLLW", "Ptr",0, "Ptr",0, "WStr","", "UInt",1) ;Folder Options, General tab
;DllCall("shell32\Options_RunDLLW", "Ptr",0, "Ptr",0, "WStr","7", "UInt",1) ;Folder Options, View tab
Code: Select all
;Run, % "rundll32 user32.dll,LockWorkStation" ;Win+L
;DllCall("user32\LockWorkStation") ;Win+L
;DllCall("powrprof\SetSuspendState", "UChar",0, "UChar",0, "UChar",0, "UChar") ;Sleep/Suspend
;DllCall("powrprof\SetSuspendState", "UChar",1, "UChar",0, "UChar",0, "UChar") ;Hibernate
;Shutdown
;https://autohotkey.com/docs/commands/Shutdown.htm
Code: Select all
;Run, control ;Control Panel (view: Category/Large icons/small icons)
;Run, ::{26EE0668-A00A-44D7-9371-BEB064C98683} ;Control Panel (view: Category)
;Run, ::{26EE0668-A00A-44D7-9371-BEB064C98683}\0 ;Control Panel\All Control Panel Items ;(view: Large icons/Small icons)
;Run, shell:ControlPanelFolder ;Control Panel\All Control Panel Items ;(view: Large icons/Small icons)
;Run, control /name Microsoft.WindowsUpdate ;Windows Update
;Run, explorer.exe shell:::{36EEF7DB-88AD-4E81-AD49-0E313F0C35F8} ;Windows Update
;if A_Is64bitOS && !(A_PtrSize=8) ;if 32-bit AHK on 64-bit PC
; DllCall("kernel32\Wow64DisableWow64FsRedirection", "Ptr*",0)
;Run, explorer.exe shell:::{36EEF7DB-88AD-4E81-AD49-0E313F0C35F8}\pageSettings ;Windows Update\Change settings
;Run, control /name Microsoft.PowerOptions /page pagePlanSettings ;Power Options\Edit Plan Settings
;Run, shell:::{025A5937-A6BE-4686-A844-36FE4BEC8B6D}\pagePlanSettings ;Power Options\Edit Plan Settings
;Run, % "control desk.cpl,,2" ;Control Panel\Appearance and Personalization\Personalization
;Run, % "rundll32 shell32.dll,Control_RunDLL desk.cpl,,2" ;Control Panel\Appearance and Personalization\Personalization
;DllCall("shell32\Control_RunDLLW", "Ptr",0, "Ptr",0, "WStr","desk.cpl,,2", "UInt",1) ;Control Panel\Appearance and Personalization\Personalization
;Run, explorer.exe shell:::{ED834ED6-4B5A-4BFE-8F11-A626DCB6A921} ;Control Panel\Appearance and Personalization\Personalization
;Run, desk.cpl ;Control Panel\Appearance and Personalization\Display\Screen Resolution
;Run, % "control desk.cpl,,0" ;Desktop Icon Settings
;Run, % "control desk.cpl,,1" ;Screen Saver Settings
;Run, % "control desk.cpl,,2" ;Control Panel\Appearance and Personalization\Personalization
;Run, % "control desk.cpl,,5" ;Window Color and Appearance
;Run, control system ;System
;Run, control /name Microsoft.System ;System
;Run, shell:::{BB06C0E4-D293-4F75-8A90-CB05B6477EEE} ;System
;Run, control /name Microsoft.NetworkAndSharingCenter ;Network and Sharing Center
;Run, shell:::{8E908FC9-BECC-40F6-915B-F4CA0E70D03D} ;Network and Sharing Center
;Run, ncpa.cpl ;Control Panel\Network and Internet\Network Connections
;Run, control netconnections ;Network Connections ;Control Panel\Network and Internet\Network Connections
;Run, ::{7007ACC7-3202-11D1-AAD2-00805FC1270E} ;Network Connections
;Run, shell:ConnectionsFolder ;Control Panel\All Control Panel Items\Network Connections
;Run, shell:NetworkPlacesFolder ;Network
;Run, appwiz.cpl ;Programs and Features (Uninstall or change a program)
;Run, shell:::{7B81BE6A-CE2B-4676-A29E-EB907A5126C5} ;Programs and Features (Uninstall or change a program)
Code: Select all
;non-obvious names
;Run, calc ;Calculator
;Run, charmap ;Character Map
;Run, cmd ;Command Prompt
;Run, mspaint ;Paint
;Run, winword ;Microsoft Word
;obvious names
;Run, excel ;Microsoft Excel
;Run, notepad ;Notepad
;Run, wordpad ;WordPad
Code: Select all
;RunWait, displayswitch /internal ;Computer only/Disconnect Projector
;RunWait, displayswitch /clone ;Duplicate
;RunWait, displayswitch /extend ;Extend
;RunWait, displayswitch /external ;Projector only
RUN CLSIDs
In the examples above, there were subtle differences in the code required to run a CLSID:
Code: Select all
;4 levels of complexity:
;Run, ::{MyCLSID}
;Run, shell:::{MyCLSID}
;Run, explorer.exe shell:::{MyCLSID}
;Run, explorer.exe shell:::{MyCLSID} ;plus call Wow64DisableWow64FsRedirection (if 32-bit AHK on 64-bit PC)
;Run, ::{20d04fe0-3aea-1069-a2d8-08002b30309d} ;My Computer
;Run, ::{26EE0668-A00A-44D7-9371-BEB064C98683} ;Control Panel (view: Category)
;Run, ::{26EE0668-A00A-44D7-9371-BEB064C98683}\0 ;Control Panel\All Control Panel Items ;(view: Large icons/Small icons)
;Run, ::{645ff040-5081-101b-9f08-00aa002f954e} ;Recycle Bin
;Run, ::{7007ACC7-3202-11D1-AAD2-00805FC1270E} ;Network Connections
;Run, shell:::{025A5937-A6BE-4686-A844-36FE4BEC8B6D}\pagePlanSettings ;Power Options\Edit Plan Settings
;Run, shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0} ;Win+R Run dialog
;Run, shell:::{7B81BE6A-CE2B-4676-A29E-EB907A5126C5} ;Programs and Features (Uninstall or change a program)
;Run, shell:::{8E908FC9-BECC-40F6-915B-F4CA0E70D03D} ;Network and Sharing Center
;Run, shell:::{BB06C0E4-D293-4F75-8A90-CB05B6477EEE} ;System
;Run, explorer.exe shell:::{36EEF7DB-88AD-4E81-AD49-0E313F0C35F8} ;Windows Update
;Run, explorer.exe shell:::{ED834ED6-4B5A-4BFE-8F11-A626DCB6A921} ;Control Panel\Appearance and Personalization\Personalization
;if A_Is64bitOS && !(A_PtrSize=8) ;if 32-bit AHK on 64-bit PC
; DllCall("kernel32\Wow64DisableWow64FsRedirection", "Ptr*",0)
;Run, explorer.exe shell:::{36EEF7DB-88AD-4E81-AD49-0E313F0C35F8}\pageSettings ;Windows Update\Change settings
EXPLORER WINDOWS (FOLDERS/SPECIAL FOLDERS/CONTROL PANEL)
Code: Select all
;based on:
;Getting CLSID or SpecialFolderConstant of an Explorer object - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=5&t=4884
q:: ;get the path for folders/special folders/Control Panel items
for oWin in ComObjCreate("Shell.Application").Windows
try MsgBox % oWin.Document.Folder.Self.Path
return
EXPLORER MENU ITEMS
- You use PostMessage (or SendMessage to wait for a notification that the message has been received), with WM_COMMAND, and the correct menu item ID.
- I would experiment by sending messages to the Explorer folder window, and also to its controls.
- This script can be used to retrieve the menu item IDs for a menu:
Get Info from Context Menu (x64/x32 compatible) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=31971
- Note: some menu item IDs are constant, but others change each time, and some require that the menu be initialised (e.g. you nudge/refresh the menu via WM_INITMENU).
Code: Select all
;PostMessage, 0x111, 41249,, ShellTabWindowClass1, A ;WM_COMMAND := 0x111 ;Back
;PostMessage, 0x111, 41250,, ShellTabWindowClass1, A ;WM_COMMAND := 0x111 ;Forward
;PostMessage, 0x111, 40994,, ShellTabWindowClass1, A ;WM_COMMAND := 0x111 ;Up one level
;PostMessage, 0x111, 28705,, SHELLDLL_DefView1, A ;Select all
;PostMessage, 0x111, 28706,, SHELLDLL_DefView1, A ;Invert Selection
;PostMessage, 0x111, 28747,, SHELLDLL_DefView1, A ;View, Details
;PostMessage, 0x111, 28753,, SHELLDLL_DefView1, A ;View, List
;PostMessage, 0x111, 31492,, SHELLDLL_DefView1, A ;View, Sort by, Name ;toggle ascending/descending
Windows 7 - invert selection, set details view/list view (trigger Explorer/Internet Explorer menu items) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=27564
==================================================
SHELL CONTEXT MENUS AND THE SENDTO FOLDER
[how to add items to shell context menus]
[the SendTo folder can be used to launch a program with the selected files as arguments]
Explorer context menu shell extensions - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=32152
==================================================
MORE TIPS
DRAG-AND-DROP TIP (DRAG TO TITLE BAR)
- If you compare Windows XP and Windows 7, it's harder to drag-and-drop files from one folder to another.
- This is because 'full row select' mode was added to the 'Details' view in Windows 7 (or perhaps Windows Vista). I.e. you can't simply drag-and-drop files to empty space, each bit of empty space is associated with a file (it is part of a row that extends from left-to-right).
- You could accidentally add a file to an archive, or launch an application, for example.
- A workaround is to drag-and-drop files to the title bar.
COPY AS PATH
- From Windows Vista onwards, you can select some files and do shift+right-click, or shift+Menu key to show a menu, and then choose 'Copy as path' to put the paths of the selected files onto the clipboard.
CHANGE A FILE'S EXTENSION (RENAME A FILE'S EXTENSION)
- Run cmd.exe, type ren, press space, and drag-and-drop a file onto the command prompt window.
- See the answers by vafylec and Synetech for more details:
Efficiently change a single file extension in Windows - Super User
https://superuser.com/questions/248501/efficiently-change-a-single-file-extension-in-windows
==================================================
EXPLORER FOLDER WINDOW MESSAGES / VIEW MODES
Code: Select all
;q:: ;Explorer folder window messages (tested on Windows 7)
ControlGet, hCtl, Hwnd,, SHELLDLL_DefView1, A
PostMessage, 0x111, 28706, 0,, % "ahk_id " hCtl ;edit, invert selection
PostMessage, 0x111, 28747, 0,, % "ahk_id " hCtl ;view, details
PostMessage, 0x111, 28753, 0,, % "ahk_id " hCtl ;view, list
PostMessage, 0x111, 28705, 0,, % "ahk_id " hCtl ;edit, select all
PostMessage, 0x111, 31492, 0,, % "ahk_id " hCtl ;view, sort by, name
return
Code: Select all
;q:: ;Explorer folder window messages (tested on Windows XP)
WinGet, hWnd, ID, A
PostMessage, 0x111, 28706, 0,, % "ahk_id " hWnd ;edit, invert selection
PostMessage, 0x111, 28716, 0,, % "ahk_id " hWnd ;view, details
PostMessage, 0x111, 28715, 0,, % "ahk_id " hWnd ;view, list
PostMessage, 0x111, 28705, 0,, % "ahk_id " hWnd ;edit, select all
return
Code: Select all
;Windows 7 view modes
;menu item ID, view mode, CurrentViewMode/IconSize
;28749 E&xtra large icons - 1 256
;28751 La&rge icons - 1 96
;28750 &Medium icons - 1 48
;28752 Small ico&ns - 2 16
;28753 &List - 3 16
;28747 &Details - 4 16
;28748 Tile&s - 6 16
;28754 Conten&t - 8 32
q:: ;windows 7 - set view mode
ControlGet, hCtl, Hwnd,, SHELLDLL_DefView1, A
PostMessage, 0x111, 28747, 0,, % "ahk_id " hCtl ;View, Details
;PostMessage, 0x111, 28753, 0,, % "ahk_id " hCtl ;View, List
return
w:: ;windows 7 - set view mode
WinGet, hWnd, ID, A
WinGetClass, vWinClass, % "ahk_id " hWnd
if !(vWinClass = "CabinetWClass") && !(vWinClass = "ExploreWClass")
return
for oWin in ComObjCreate("Shell.Application").Windows
{
if (oWin.HWND = hWnd)
{
;MsgBox, % oWin.Document.CurrentViewMode " " oWin.Document.IconSize
oWin.Document.CurrentViewMode := 4 ;View, Details
;oWin.Document.CurrentViewMode := 3 ;View, List
oWin.Document.IconSize := 16
break
}
}
oWin := ""
return
IFolderView::SetCurrentViewMode method (Windows)
https://msdn.microsoft.com/en-us/library/windows/desktop/bb775618(v=vs.85).aspx
FOLDERVIEWMODE enumeration (Windows)
https://msdn.microsoft.com/en-us/library/windows/desktop/bb762510(v=vs.85).aspx
[lists of Explorer window message IDs (general comments + Windows XP constants)]
Automating Windows Explorer - Ask for Help - AutoHotkey Community
https://autohotkey.com/board/topic/5936-automating-windows-explorer/
[note: some IDs in context menus are constant, some are variable]
Get Info from Context Menu (x64/x32 compatible) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=31971
[set view mode via objects]
Reading Win 10 File Explorer View Mode - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=28304
==================================================
FILE ICONS
[show/hide hidden files, show/hide extensions (via SHGetSetSettings)]
[refresh thumbnails/icons][when icons/thumbnails out-of-date][windows 7]
Refreshing the file explorer - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=12656
AutoHotkey_L v1.1.08 - Page 3 - Announcements - AutoHotkey Community
https://autohotkey.com/board/topic/82612-autohotkey-l-v1108/page-3#entry536021
==================================================
HIDE/SHOW EXTENSIONS, HIDE/SHOW HIDDEN FILES
Code: Select all
q:: ;toggle hide/show extensions (tested on Windows 7)
;SSF_SHOWALLOBJECTS := 0x1
vNum := 0x1
DllCall("shell32\SHGetSetSettings", "Ptr",&SHELLSTATE, "UInt",vNum, "Int",0)
vState := NumGet(SHELLSTATE, "UInt")
NumPut(vState ? 0 : vNum, SHELLSTATE, "UInt")
DllCall("shell32\SHGetSetSettings", "Ptr",&SHELLSTATE, "UInt",vNum, "Int",1)
;refresh Desktop/folder windows (appeared to work for hide/show extensions, but not hide/show hidden files)
SHCNE_ASSOCCHANGED := 0x8000000
DllCall("shell32\SHChangeNotify", "Int",0x8000000, "UInt",0, "Ptr",0, "Ptr",0)
return
Code: Select all
q:: ;toggle hide/show hidden files (tested on Windows 7)
;SSF_SHOWEXTENSIONS := 0x2
vNum := 0x2
VarSetCapacity(SHELLSTATE, 36, 0)
DllCall("shell32\SHGetSetSettings", "Ptr",&SHELLSTATE, "UInt",vNum, "Int",0)
vState := NumGet(SHELLSTATE, "UInt")
NumPut(vState ? 0 : vNum, SHELLSTATE, "UInt")
DllCall("shell32\SHGetSetSettings", "Ptr",&SHELLSTATE, "UInt",vNum, "Int",1)
;refresh Desktop/folder windows
DetectHiddenWindows, On
GroupAdd, WinGroupFolder, ahk_class CabinetWClass
GroupAdd, WinGroupFolder, ahk_class ExploreWClass
PostMessage, 0x111, 28931,, SHELLDLL_DefView1, ahk_class Progman
WinGet, vWinList, List, ahk_group WinGroupFolder
Loop % vWinList
PostMessage, 0x111, 41504,, ShellTabWindowClass1, % "ahk_id " vWinList%A_Index%
;PostMessage, 0x111, 28931,, SHELLDLL_DefView1, % "ahk_id " vWinList%A_Index% ;also works
return
HIDE/SHOW DESKTOP ICONS
Code: Select all
q:: ;toggle hide/show desktop icons (tested on windows 7)
PostMessage, 0x111, 29698,, SHELLDLL_DefView1, ahk_class Progman ;show desktop icons (toggle)
return
w:: ;show desktop icons (tested on windows 7)
ControlGet, vCtlStyle, Style,, SysListView321, ahk_class Progman
if !(vCtlStyle & 0x10000000) ;WS_VISIBLE := 0x10000000
PostMessage, 0x111, 29698,, SHELLDLL_DefView1, ahk_class Progman ;show desktop icons (toggle)
return
e:: ;hide desktop icons (tested on windows 7)
ControlGet, vCtlStyle, Style,, SysListView321, ahk_class Progman
if (vCtlStyle & 0x10000000) ;WS_VISIBLE := 0x10000000
PostMessage, 0x111, 29698,, SHELLDLL_DefView1, ahk_class Progman ;show desktop icons (toggle)
return
Show/hide desktop icons in Windows 7 - Ask for Help - AutoHotkey Community
https://autohotkey.com/board/topic/43524-showhide-desktop-icons-in-windows-7/
On Windows 7, the 'Show desktop icons' menu item ID was 30988, but this didn't work as the wParam value.
==================================================
REFRESH DESKTOP/FOLDER ICONS
Code: Select all
q:: ;refresh desktop/folder icons (tested on Windows 7)
;e.g. on Desktop: icons for files no longer on Desktop, disappear
;however on Desktop: thumbnails for images inside folders not updated
;SHCNE_ASSOCCHANGED := 0x8000000
DllCall("shell32\SHChangeNotify", "Int",0x8000000, "UInt",0, "Ptr",0, "Ptr",0)
return
https://autohotkey.com/board/topic/82612-autohotkey-l-v1108/page-3#entry536021
==================================================
MOVE OFF-SCREEN DESKTOP ICONS BACK TO VISIBLE AREA
note: you may want to take a printscreen, to backup the icon order, before moving icons
4 approaches:
[set icon size from medium to small to medium]
right-click, View, small icons
right-click, View, medium icons
the off-screen icons appear as a column on the right-hand side
[cut and paste]
[note: perhaps TeraCopy interferes with (blocks) this]
press right, to select an off-screen icon
press the Menu key, Cut
move the cursor (to a suitable location)
right-click, Paste
[auto-arrange icons]
[warning: this changes the order]
right-click, View, tick Auto arrange icons
[change listview item coordinates via LVM_SETITEMPOSITION]
[x64 & x32 fix] DeskIcons - Get/Set Desktop Icon Positions - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=3529
==================================================
TASKBAR + SYSTRAY (TASKBAR BUTTONS + SYSTRAY ICONS)
[ list taskbar buttons + systray icons]
Windows Update: detect if important updates available - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=26727
[ list taskbar windows (get hWnds)][ list taskbar buttons]
Recover accidentally closed window/program - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=31704
[ list information from tray icons][TrayIcon.ahk]
[LIB] TrayIcon - Sean's TrayIcon for Unicode and 64 bit - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=1229
GUIs via DllCall: text functions (get/set internal/external control text) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40514
[check for Windows updates including in systray]
Windows Update: detect if important updates available - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=26727
[move mouse to taskbar button]
Move mouse to taskbar to use AeroPeek - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=27147
[get/set taskbar auto-hide/lock states]
Get taskbar autohide state? Solved - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=39123&p=179081#p179081
[set taskbar position]
Taskbar - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=59239&p=251311#p251311
[group taskbar buttons: always/never combine]
Getting explorer to 'reload' registry changes - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=39494&p=180845#p180845
[hide/show tray icons]
Is there a way to put an icon outside the hidden tray icons by default? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=58992
[remove systray icons for processes that were abruptly closed]
How to remove systray icon after process was closed? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=69887
==================================================
RECENT ITEMS (MY RECENT DOCUMENTS)
list Recent Items (My Recent Documents) (Start Menu) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=31386
Start menu, Recent Items menu, focus first/last item - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=27560
==================================================
GET DESKTOP ICON INFO
get full paths of selected files on Desktop and Common File Dialogs - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=31135
[get access to the desktop shell object]
Create new file in current explorer window? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=9618&p=53361#p53361
==================================================
EXPLORER WINDOWS: COLUMNS
Explorer column interaction (get/set: which appear, width, ascending/descending order) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=33129
Code: Select all
;e.g. columns:
;prop:System.ItemNameDisplay; ;Name
;prop:System.DateModified; ;Date modified
;prop:System.DateCreated; ;Date created
;prop:System.ItemTypeText; ;Type
;prop:System.Size; ;Size
#IfWinActive ahk_class CabinetWClass
q:: ;explorer - sort files by date modified
#IfWinActive ahk_class ExploreWClass
q:: ;explorer - sort files by date modified
WinGet, hWnd, ID, A
for oWin in ComObjCreate("Shell.Application").Windows
{
if (oWin.HWND = hWnd)
{
MsgBox, % oWin.Document.SortColumns ;show current sort columns
;oWin.Document.SortColumns := "prop:System.DateModified;" ;sort by date modified ascending (oldest first)
oWin.Document.SortColumns := "prop:-System.DateModified;" ;sort by date modified descending (newest first)
;oWin.Document.SortColumns := "prop:System.ItemNameDisplay;" ;sort by name ascending (A-Z)
;oWin.Document.SortColumns := "prop:-System.ItemNameDisplay;" ;sort by name descending (A-Z)
break
}
}
oWin := ""
return
#IfWinActive
DIALOGS
[get a single Properties dialog for multiple files (that don't have to be in the same folder)]
SHMultiFileProperties - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=30483
==================================================
FILE PROPERTIES
[check FileXXX functions]
Alphabetical Command and Function Index
https://autohotkey.com/docs/commands/
Loop (files & folders)
https://autohotkey.com/docs/commands/LoopFile.htm
[get file properties via objects e.g. length (duration), image dimensions]
[uses ComObjCreate("Shell.Application") and GetDetailsOf]
FileGetProperties - Ask for Help - AutoHotkey Community
https://autohotkey.com/board/topic/63697-filegetproperties/
==================================================
WINDOW THEME
simple method:
Code: Select all
;Run, C:\Windows\Resources\Ease of Access Themes\classic.theme
;Run, C:\Users\%A_UserName%\AppData\Local\Microsoft\Windows\Themes\Custom.theme
https://autohotkey.com/boards/viewtopic.php?f=5&t=31343
[better method]
Change w7 theme (for automatic postinstall) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=18879&p=91548#p91548
==================================================
COMMAND PROMPT (CMD)
Code: Select all
q:: ;run cmd (hidden)
vUrl := "https://www.google.com/"
Run, cmd.exe /c start "C:\Program Files\Internet Explorer\iexplore.exe" "%vUrl%",, Hide
return
w:: ;run cmd (keep open)
vUrl := "https://www.google.com/"
Run, cmd.exe /k start "C:\Program Files\Internet Explorer\iexplore.exe" "%vUrl%"
return
ARRANGE WINDOWS
Code: Select all
;PostMessage, 0x111, 403, 0,, ahk_class Shell_TrayWnd ;Cascade windows
;PostMessage, 0x111, 404, 0,, ahk_class Shell_TrayWnd ;Show windows side by side ;(tile horizontally) (tile as columns)
;PostMessage, 0x111, 405, 0,, ahk_class Shell_TrayWnd ;Show windows stacked ;(tile vertically) (tile as rows)
;PostMessage, 0x111, 416, 0,, ahk_class Shell_TrayWnd ;Undo ;(undo cascade/tile)
;note: the terms 'tile horizontally' and 'tile vertically' are confusing and often used to mean opposites
;'tile as columns' and 'tile as rows' are more sensible
;https://www.safaribooksonline.com/library/view/filemaker-pro-9/9780596514136/httpatomoreillycomsourceoreillyimages44774.png
;note: these numbers (tested on Windows 7) differ from those obtained by querying the context menu (on Windows 7):
;404 Cascade windows
;406 Show windows stacked
;405 Show windows side by side
;408 Show the desktop
;421 Start Task Manager
;425 Lock the taskbar
;414 Properties
RETRIEVE THE CONTENTS OF AUTOHOTKEY'S 'A_' VARIABLES DIRECTLY
[A_ComSpec/A_Temp/A_Language/A_ComputerName/A_UserName/A_WinDir]
[A_AppData/A_Desktop/A_MyDocuments/A_ProgramFiles/A_Programs/A_StartMenu/A_Startup]
[also: environment variables, Recent folder path]
[note: A_Programs and A_Startup are Start menu folders]
Code: Select all
q:: ;retrieve contents of 'A_' variables directly (based on AHK v1.1 source code)
;A_ComSpec (ComSpec)
VarSetCapacity(vText, 0x7FFF*2)
vVarName := "ComSpec"
DllCall("kernel32\GetEnvironmentVariable", "Str",vVarName, "Str",vText, "UInt",0x7FFF, "UInt")
vComSpec := vText
;A_Temp
;MAX_PATH := 260
VarSetCapacity(vTemp, 261*2)
DllCall("kernel32\GetTempPath", "UInt",261, "Str",vTemp, "UInt")
vTemp := RTrim(vTemp, "\")
;A_Language
vLanguage := DllCall("kernel32\GetSystemDefaultUILanguage", "UShort")
vLanguage := Format("{:04X}", vLanguage)
;A_ComputerName
;MAX_COMPUTERNAME_LENGTH := 31
VarSetCapacity(vComputerName, 32*2)
vSize := 32
DllCall("kernel32\GetComputerName", "Str",vComputerName, "UInt*",vSize)
;A_UserName
;UNLEN := 256
VarSetCapacity(vUserName, 257*2)
vSize := 257
DllCall("advapi32\GetUserName", "Str",vUserName, "UInt*",vSize)
;A_WinDir
;MAX_PATH := 260
VarSetCapacity(vWinDir, 260*2)
DllCall("kernel32\GetWindowsDirectory", "Str",vWinDir, "UInt",260, "UInt")
;A_AppData/A_AppDataCommon
;A_Desktop/A_DesktopCommon
;A_MyDocuments
;A_ProgramFiles (ProgramFiles)
;A_Programs/A_ProgramsCommon
;A_StartMenu/A_StartMenuCommon
;A_Startup/A_StartupCommon
;CSIDL_APPDATA := 26 ;CSIDL_COMMON_APPDATA := 35
;CSIDL_DESKTOPDIRECTORY := 16 ;CSIDL_COMMON_DESKTOPDIRECTORY := 25
;CSIDL_MYDOCUMENTS := 5
;CSIDL_PROGRAM_FILES := 38
;CSIDL_PROGRAMS := 2 ;CSIDL_COMMON_PROGRAMS := 23
;CSIDL_STARTMENU := 11 ;CSIDL_COMMON_STARTMENU := 22
;CSIDL_STARTUP := 7 ;CSIDL_COMMON_STARTUP := 24
;(note: there is no 'A_Recent' variable at present)
;CSIDL_RECENT := 8
;SHGFP_TYPE_CURRENT := 0
oArray := {AppData:26,AppDataCommon:35,Desktop:16,DesktopCommon:25,MyDocuments:5,ProgramFiles:38,Programs:2,ProgramsCommon:23,StartMenu:11,StartMenuCommon:22,Startup:7,StartupCommon:24}
oArray["Recent"] := 8
for vKey, vNum in oArray
{
VarSetCapacity(vPath, 261*2)
DllCall("shell32\SHGetFolderPath", "Ptr",0, "Int",vNum, "Ptr",0, "UInt",0, "Str",vPath)
v%vKey% := vPath
}
MsgBox, % vRecent
vList := "ComSpec,Temp,Language,ComputerName,UserName,WinDir,AppData,AppDataCommon,Desktop,DesktopCommon,MyDocuments,ProgramFiles,Programs,ProgramsCommon,StartMenu,StartMenuCommon,Startup,StartupCommon"
vOutput := ""
Loop Parse, vList, % ","
{
vTemp2 := "A_" A_LoopField
if (%vTemp2% = "")
vTemp2 := A_LoopField
vOutput .= (A_Index=1?"":"`r`n") vTemp2 "`r`n" %vTemp2% "`r`n" v%A_LoopField% "`r`n"
}
Clipboard := vOutput
MsgBox, % vOutput
return
LIST ENVIRONMENT VARIABLES
Code: Select all
q:: ;list environment variables
DetectHiddenWindows, On
Run, % ComSpec,, Hide, vPID
WinWait, % "ahk_pid " vPID
DllCall("kernel32\AttachConsole", "UInt",vPID)
oShell := ComObjCreate("WScript.Shell")
oExec := oShell.Exec(ComSpec " /c set")
vStdOut := ""
while !oExec.StdOut.AtEndOfStream
vStdOut := oExec.StdOut.ReadAll()
Clipboard := vStdOut
DllCall("kernel32\FreeConsole")
Process, Close, % vPID
MsgBox, % vStdOut
return
jeeswg's documentation extension tutorial - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=33596
==================================================
COMMAND LINE: TASK MANAGER: SHOW COLUMN
To show the Command Line column in Task Manager:
if the Command Line column is not visible in the 'Processes' tab,
go to 'View, Select Columns...' and tick 'Command Line'.
==================================================
COMMAND LINE: RETRIEVE COMMAND-LINE STRING FOR A WINDOW
Note: MSDN uses the term 'command-line string' here:
GetCommandLine function (Windows)
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156(v=vs.85).aspx
Code: Select all
;e.g. retrieve command-line string for active window
;WinGet, vPID, PID, A
;MsgBox, % JEE_ProcessGetCommandLine(vPID)
JEE_ProcessGetCommandLine(vPIDOrName:="")
{
if !vPID := ProcessExist(vPIDOrName)
return
oWMI := ComObjGet("winmgmts:")
oQueryEnum := oWMI.ExecQuery("Select * from Win32_Process where ProcessId=" vPID)._NewEnum()
if oQueryEnum[oProcess]
vCmdLn := oProcess.CommandLine
oWMI := oQueryEnum := oProcess := ""
return vCmdLn
}
PROCESS NAME GET PATH
Best way to get the path to an executable - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=36484&p=168051#p168051
Best way to find an executable - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=44630&p=202086#p202086
useful registry keys:
HKEY_CLASSES_ROOT\Applications
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
Code: Select all
;e.g. get process path
RegRead, vPath, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE
MsgBox, % vPath
;e.g. get multiple process paths
vList := "chrome.exe,firefox.exe,iexplore.exe"
vOutput := ""
Loop Parse, vList, % ","
{
vName := A_LoopField
RegRead, vPath, % "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\" vName
vOutput .= vName "`t" vPath "`r`n"
}
MsgBox, % vOutput
;e.g. get multiple process paths
vOutput := ""
oArray := []
Loop Reg, % "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths", % "K"
{
RegRead, vPath, % A_LoopRegKey "\" A_LoopRegSubkey "\" A_LoopRegName
oArray.Push(A_LoopRegName "`t" vPath)
}
Loop % vIndex := oArray.Length()
vOutput .= oArray[vIndex--] "`r`n"
Clipboard := vOutput
MsgBox, % vOutput
return
WINDOWS FOLDER LOCATIONS (WINDOWS XP/WINDOWS 7)
- Note: you can paste these into the address bar of an Explorer window or into the Run dialog (which you can show by pressing Win+R).
- Environment variables like %appdata%, %temp%, %username%, and 'shell:' folders like shell:Desktop will be resolved.
Windows XP folders:
A_AppData = C:\Documents and Settings\%username%\Application Data
A_AppDataCommon = C:\Documents and Settings\All Users\Application Data
A_Desktop = C:\Documents and Settings\%username%\Desktop
A_DesktopCommon = C:\Documents and Settings\All Users\Desktop
A_MyDocuments = C:\Documents and Settings\%username%\My Documents
A_ProgramFiles = C:\Program Files
A_Programs = C:\Documents and Settings\%username%\Start Menu\Programs
A_ProgramsCommon = C:\Documents and Settings\All Users\Start Menu\Programs
A_StartMenu = C:\Documents and Settings\%username%\Start Menu
A_StartMenuCommon = C:\Documents and Settings\All Users\Start Menu
A_Startup = C:\Documents and Settings\%username%\Start Menu\Programs\Startup
A_StartupCommon = C:\Documents and Settings\All Users\Start Menu\Programs\Startup
A_Temp = C:\DOCUME~1\%username%\LOCALS~1\Temp
A_WinDir = C:\WINDOWS
Recent = C:\Documents and Settings\%username%\Recent
Windows 7 folders:
A_AppData = C:\Users\%username%\AppData\Roaming
A_AppDataCommon = C:\ProgramData
A_Desktop = C:\Users\%username%\Desktop
A_DesktopCommon = C:\Users\Public\Desktop
A_MyDocuments = C:\Users\%username%\Documents
A_ProgramFiles = C:\Program Files
A_Programs = C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
A_ProgramsCommon = C:\ProgramData\Microsoft\Windows\Start Menu\Programs
A_StartMenu = C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu
A_StartMenuCommon = C:\ProgramData\Microsoft\Windows\Start Menu
A_Startup = C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
A_StartupCommon = C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
A_Temp = C:\Users\%username%\AppData\Local\Temp
A_WinDir = C:\Windows
Recent = C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Recent
'shell:' folders:
note: 'shell:MyComputerFolder' doesn't work on Windows XP
note: there is no 'shell:Temp' shortcut
A_AppData = shell:AppData
A_AppDataCommon = shell:Common AppData
A_Desktop = shell:Desktop
A_DesktopCommon = shell:Common Desktop
A_MyDocuments = shell:Personal
A_ProgramFiles = shell:ProgramFiles
A_Programs = shell:Programs
A_ProgramsCommon = shell:Common Programs
A_StartMenu = shell:Start Menu
A_StartMenuCommon = shell:Common Start Menu
A_Startup = shell:Startup
A_StartupCommon = shell:Common Startup
A_Temp = %temp%
A_WinDir = shell:Windows
MyComputer = shell:MyComputerFolder
Recent = shell:Recent
Link with more 'shell:' folders:
Shell Commands to Access the Special Folders in Windows 10/8/7/Vista/XP » Winhelponline
http://www.winhelponline.com/blog/shell-commands-to-access-the-special-folders/
==================================================
WINDOW EVENTS
[SetWinEventHook]
Event Constants (Windows)
https://msdn.microsoft.com/en-us/library/windows/desktop/dd318066(v=vs.85).aspx
Simple File Explorer Fix - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=48911&p=219950#p219950
Is possible to get path when Explorer window is closing and restore when is opening? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=49842&p=221423#p221423
Trouble getting shellhook to detect window change - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=51265&p=226227#p226227
[WMI events e.g. WmiMonitorBrightnessEvent]
Detect screen brightness changes in Windows 10 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=58914
==================================================
LAUNCH/RELOAD SCRIPT AS ADMIN/NON-ADMIN (RUN AS ADMINISTRATOR)
Reloading: Admin to Non-Admin - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=7752
==================================================
SCREEN BRIGHTNESS
3 ways to dim the screen - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=39580
Brightness adjust via scroll wheel - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=69857
==================================================
ENABLE/DISABLE WINDOWS UPDATE
Code: Select all
;open Windows Update\Change settings (tested on Windows 7)
DllCall("kernel32\Wow64DisableWow64FsRedirection", "Ptr*",0)
Run, explorer.exe shell:::{36EEF7DB-88AD-4E81-AD49-0E313F0C35F8}\pageSettings
return
;under 'Important updates', choose from the drop-down list
;or, less direct:
;open Windows Update\Change settings (tested on Windows 7)
Run, control /name Microsoft.WindowsUpdate ;Windows Update
return
;then manually click 'Change settings'
;under 'Important updates', choose from the drop-down list
CHKDSK
Explorer: list chkdsk results - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=62719
==================================================
REFRESH EXPLORER
Refreshing the file explorer - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=12656
(solved) How do I update explorer/windows with registry changes? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=14567
Getting explorer to 'reload' registry changes - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=39494&p=180845#p180845
==================================================
CLIPBOARD
Various threads are listed here:
jeeswg's homepage - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=17&t=30931&p=144437#p144437
==================================================
RE-ENABLE HARDWARE AFTER HIBERNATING PC
[re-enable USB mouse after hibernating PC]
USB mouse stops working after hibernating PC - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=64809
==================================================
RESOURCES
C:\Windows\diagnostics (e.g. on Windows 7)
contains useful ps1 files, which can be translated to AHK for achieving certain tasks:
e.g. C:\Windows\diagnostics\system\AERO\CL_Utility.ps1, see:
Change w7 theme (for automatic postinstall) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=18879&p=91548#p91548
==================================================
MORE LINKS (SEE 'SHELL - ')
best utilities + best AutoHotkey scripts (+ useful tips) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=7&t=28149