 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Trubbleguy
Joined: 20 Jan 2007 Posts: 76 Location: Melbourne
|
Posted: Fri Feb 01, 2008 1:25 pm Post subject: Alternate folder delete for VISTA *FAST* |
|
|
Vista users are probably aware of the damn annoying S L O W Delete that slows down the whole pc when you delete, move or Copy.
this small prog will insert itself into system32 folder, and also the right click menu when you right click on a folder and offers Delete Folder Fast menu.
compile the purpose named vdel.ahk to vdel.exe and run it, when it detects the vdel.ahk it auto copies its exe self, to system32 and adds itself to the right mouse click menu for folders.
Comparisons:
45,716 dummy zip files using windows took 132 seconds to delete (dont you just love the way vista tells you how long its gonna take)
45,716 dummy zip files using vdel.exe took 16 seconds.
| Code: | ; Language: English
; Platform: Win9x/NT
; Author: trubbleguy@trubbleguy.com
;IMPORTANT call this ahk file "vdel.ahk" or it wont auto update after compiling.
#NoEnv
SendMode Input
#SingleInstance,Force
dir = %A_ScriptDir%
ifexist,%A_ScriptDir%\vdel.ahk
{
gosub regadd
MsgBox, compile and then run compiled version in this folder to update
goto exit
}
stringreplace,1,1,",,all
If %1%
dir = %1%
_E = 0
RegRead, regOutputVar,HKEY_CLASSES_ROOT, Directory\shell\vistadelete
If Errorlevel
{
MsgBox,3,,Would you like to Install VistaDelete?`n`nThis will add VistaDelete to the Right click Context Menu for FOLDER icons`nThen you can right click on any folder and Select "Delete Folder Fast"`n`n You can Press F11 anytime while this program is running to add the menu`n`nClick Yes`, Press Y or Enter to Install or NO or Esc to use just in this folder,25
IfMsgBox,Yes
Gosub regadd
}
if dir = %A_ScriptDir%
Exitapp
MsgBox,3,,We will be Deleting`n%dir%`nOnce you accept`, it is an unstoppable delete`n`nClick Yes`, Press Y or Enter to continue (or F11),25
IfMsgBox,Yes
Gosub go
IfMsgBox,No
Gosub exit
IfMsgBox,Cancel
Gosub exit
IfMsgBox,Timeout
Gosub exit
return
F11::Gosub regadd
F12::gosub exit
Esc::gosub exit
go:
FileRemoveDir, %dir% ,1
exit:
MsgBox,,Done,Done,1
ExitApp
return
regadd:
IfExist,%A_ScriptDir%\vdel.exe
{
RegWrite, Reg_Sz, HKEY_CLASSES_ROOT, Directory\shell\vistadelete,,Delete Folder fast
RegWrite, Reg_Sz, HKEY_CLASSES_ROOT, Directory\shell\vistadelete\command,,vdel.exe "`%1"
filecopy,%A_ScriptDir%\vdel.exe,c:\windows\system32\,1
MsgBox, VistaDelete has now been installed in SYSTEM32 and added to Context Menu for FOLDERS`nYou can now Right CLick on any folder to Delete files inside`, including sub folders.
}
return
|
Right click any folder you want to delete after installing and select "DELETE FOLDER FAST" you get one final abort option to say no.
my Antivirus doesnt ping it, but due to the way it works there is a possibility some antivirus progs might ping. _________________

Last edited by Trubbleguy on Fri Feb 08, 2008 11:51 pm; edited 3 times in total |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Fri Feb 01, 2008 1:30 pm Post subject: |
|
|
This explorer bug is supposed to be fixed in SP1 but it's great to see patches have already been made, and with ahk! _________________
 |
|
| Back to top |
|
 |
wrecklass
Joined: 19 Mar 2007 Posts: 23
|
Posted: Fri Feb 08, 2008 7:16 pm Post subject: |
|
|
Interesting, and the way it is written, amazingly dangerous for most users.
When I just tried running the script itself I got several message boxes for some reason. One said the program had been installed, although it had not because I hadn't compiled it yet. One told me to compile the script first and the last msgbox said the program was 'Done.' Not sure why it displayed all of the msgboxes at the same time, but something is wrong with the script.
Worse, when I compiled the script it asked if I wanted to Install it, as I expected it to. I said no and it then told me it was going to delete the folder it happened to be launched from, which happend to be my Desktop folder. Not a very good idea to have the program's default behavior to delete the folder where it is first launched from. An unsuspecting person might have accidentally hit the 'Yes' key and had a big headache on their hands. |
|
| Back to top |
|
 |
Trubbleguy
Joined: 20 Jan 2007 Posts: 76 Location: Melbourne
|
Posted: Fri Feb 08, 2008 11:32 pm Post subject: |
|
|
thanks for pointing out the Compiled danger when run directly in a folder, it escaped my notice.
added check for vdel.exe existing
added check to make sure the folder it lives in cant be deleted using
if dir = %A_ScriptDir%
Exitapp
when it is run uncompiled no value goes to %1% , it cannot delete anything.
I did add a check for vdel.exe before adding to reg and system32 though.
I did actually make sure if it was run in ahk form it only wants to install itself in system32 and context menu (only if a compiled exe is present ) _________________
 |
|
| Back to top |
|
 |
kasper Guest
|
Posted: Sat Jul 05, 2008 8:57 am Post subject: |
|
|
how do i make it work?
I have created a txt file with the code, one with .ahk and one with .exe. That donīt work. Am i doing something wrong? |
|
| Back to top |
|
 |
Trubbleguy
Joined: 20 Jan 2007 Posts: 76 Location: Melbourne
|
Posted: Sat Jul 05, 2008 9:32 am Post subject: |
|
|
run the compiled exe and allow it to set itself with right click menu
then right click any folder you want to delete and select it from the menu |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|