Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- ==================================================
- ;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
- ===================================================
- ;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
- ------------------------------------------------------------------
- ;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
- =======================================================
- ;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
- -----------------------------------------------------------------
- ;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
- =========================================================
- ;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
- ==========================================================
- ;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
- =====================================================
- ;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
- ======================================================
- ;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)
- ==================================================
- ;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
- ===================================================
- ;RunWait, displayswitch /internal ;Computer only/Disconnect Projector
- ;RunWait, displayswitch /clone ;Duplicate
- ;RunWait, displayswitch /extend ;Extend
- ;RunWait, displayswitch /external ;Projector only
- ====================================================
- ;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
- ================================================
- ;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
- =======================================================
- ;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
- ========================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement