Code:
; ------------------------------------------------------------------------------
;
; @@@@@@@ @@
; @ @ @
; @ @
; @ @ @@@ @@@ @@@@@@ @ @@@@@ @@@ @@ @@@@@ @@@ @@
; @@@@ @ @ @ @ @ @ @ @@ @ @ @ @@ @
; @ @ @@@ @ @ @ @ @ @ @@@@@@@ @
; @ @@@ @ @ @ @ @ @ @ @
; @ @ @ @ @ @ @ @ @ @ @ @ @
; @@@@@@@ @@@ @@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@
; @
; @@@
;
; ------------------------------------------------------------------------------
Explorer_Init:
GroupAdd, ExplorerGroup, ahk_class ExploreWClass
GroupAdd, ExplorerGroup, ahk_class CabinetWClass
return
; ------------------------------------------------------------------------------
; Hotkeys
; ------------------------------------------------------------------------------
#IfWinActive, ahk_group ExplorerGroup
; Alt + 1|2|3|4|5 = set current list view display mode
!&::PostMessage, 0x111, 28716,,, A ; Details
!é::PostMessage, 0x111, 28715,,, A ; List
!"::PostMessage, 0x111, 28714,,, A ; Small Icons
!'::PostMessage, 0x111, 28718,,, A ; Tiles
!(::PostMessage, 0x111, 28717,,, A ; Thumbnails
; Ctrl + Shift + A = invert selection
^+a::Send !ei
; Ctrl + C = start a command prompt in the current directory
!c::
WinGetActiveTitle, title
Run %ComSpec%, %title%
return
; Ctrl + D = duplicate item
^d::Send ^c^v
; create a new text file
!d::Send !fnt ; Alt -> File -> New -> Text document
; create a new directory
!f::
WinGetActiveTitle, path
loop, 100
{
name := A_Index == 1 ? "New Folder" : "New Folder (" . A_Index . ")"
IfNotExist, %path%\%name%
{
FileCreateDir,%path%\%name%
Send, {F5}
break
}
}
return
; Alt + E = show/hide file extensions
!e::Gosub, Explorer_Toggle_HideFileExtensions
; Alt + H = show/hide hidden files
!h::Gosub, Explorer_Toggle_ShowHiddenFiles
; Alt + O = opens folder options
!o::PostMessage, 0x111, 28771,,, A
; Alt + U = customize folder
!u::PostMessage, 0x111, 28722,,, A
; Alt + T = show/hide the tree view
!t::SendMessage, 0x111, 41525,,, A
; ALT + N = connect network drive
!n::PostMessage, 0x111, 41089,,, A
; ALT + SHIFT + N = disconnect network drive
+!n::PostMessage, 0x111, 41090,,, A
#IfWinActive
Explorer_Toggle_HideFileExtensions:
RootKey = HKEY_CURRENT_USER
SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
RegRead, HiddenExt_Status, % RootKey, % SubKey, HideFileExt
HiddenExt_Status := !HiddenExt_Status
RegWrite, REG_DWORD, % RootKey, % SubKey, HideFileExt, %HiddenExt_Status%
Sleep 500
PostMessage, 0x111, 28931,,, A
Return
Explorer_Toggle_ShowHiddenFiles:
RootKey = HKEY_CURRENT_USER
SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
RegRead, HiddenFiles_Status, % RootKey, % SubKey, Hidden
if HiddenFiles_Status = 2
RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 1
else
RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 2
PostMessage, 0x111, 28931,,, A
ToolTip, % "Display hidden files: " . (HiddenFiles_Status == "2" ? "ON" : "OFF")
Sleep, 500
ToolTip
return
Just an update with SKAN's hiding/showing file extensions trick.
Also added: Alt+N and Alt+Shift+N to show the connect network drive na disconnect network drive dialogs.