Thanks, glad to see you like it.
I forgot to post the source code :
;; FileNanny
;; "Go to your room !"
;; by ak
GetKeyState kstate, Shift
if kstate = D
editFolder = 1
#SingleInstance ignore
if 0 = 0
{
if strlen(winX) = 0
winX := (A_Screenwidth - 180) / 2
if strlen(winY) = 0
winY := (A_Screenheight - 130) / 2
gosub CreateGUI
}
else
{
Loop, %0%
{
param := %A_Index%
SplitPath param, fileName, dirName
StringSplit rawName, fileName, "."
if editFolder = 1
{
InputBox InputRawName, FileNanny, Name of the folder to create, , 320, 120, , , , , %rawName1%
rawName1 = %InputRawName%
if ErrorLevel
ExitApp
}
dirToCreate = %dirName%\%rawName1%
FileCreateDir %dirToCreate%
FileMove %param%, %dirToCreate%
}
ExitApp
}
return
CreateGUI:
gui destroy
RegRead, regTest, HKEY_CLASSES_ROOT, *\shell\FileNanny
if strlen(regTest) = 0
{
button1Text = Add context menu item
button1Action = addCMI
}
else
{
button1Text = Remove context menu item
button1Action = remCMI
}
sendToFolder = %UserProfile%\SendTo
ifnotExist %sendToFolder%\filenanny.lnk
{
button2text = Add 'Send to' shortcut
button2action = addST
}
else
{
button2text = Remove 'Send to' shortcut
button2action = remST
}
Gui, Font, s9 w600
Gui, Add, Text, x20 y10 w150 h20 , FileNanny configuration
Gui font, norm
Gui, Add, Button, x14 y35 w150 h30 g%button1Action%, %button1Text%
Gui, Add, Button, x14 y75 w150 h30 g%button2Action%, %button2Text%
Gui, Add, Button, x55 y120 w70 h30 gQuit, Quit
Gui, Show, x%winX% y%winY% h160 w180, FileNanny
return
AddCMI:
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\FileNanny, , FileNann&y this
RegWrite, REG_SZ, HKEY_CLASSES_ROOT, *\shell\FileNanny\command, , "%A_ScriptFullPath%" "`%L"
gosub refreshGUI
return
RemCMI:
RegDelete HKEY_CLASSES_ROOT, *\shell\FileNanny
gosub refreshGUI
return
addST:
FileCreateShortcut, %A_ScriptFullPath%, %sendToFolder%\filenanny.lnk
gosub refreshGUI
return
remST:
FileDelete, %sendToFolder%\filenanny.lnk
gosub refreshGUI
return
refreshGUI:
winId := WinExist("FileNanny")
WinGetPos winX, winY, , , ahk_id %winId%
gosub CreateGUI
return
Quit:
GuiClose:
GuiEscape:
ExitApp
return