Delete a folder without its content

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
me361
Posts: 2
Joined: 19 Sep 2018, 08:55

Delete a folder without its content

19 Sep 2018, 09:35

Hey there, so i'm new to ahk and trying to make my first script that I just currently needed for work:
I'm re-organising some folder structures and needed a function that would get all files from selected folder and delete it. Its kinda working but it is for only working for this special case where the folder is called "T..." - so I wanted to ask you if you know...
option 1: a way to reverse the current selection (Windows has no build in short key for that - dont know why)
or option 2: store current folder - and later get back to that selection

thanks!

here is the script so far:

^+Delete::Send, {Enter} Send, ^a Send, ^x Send, {Backspace} Send, ^v Send, t Send, {Delete}
return

(go in folder, get files, go back, paste them, get empty folder, delete)
User avatar
NovaRanger
Posts: 68
Joined: 23 Oct 2014, 02:05

Re: Delete a folder without its content

19 Sep 2018, 10:17

I had a script for exactly this requirement in the past..
Please wait, I'll get it.
User avatar
NovaRanger
Posts: 68
Joined: 23 Oct 2014, 02:05

Re: Delete a folder without its content

19 Sep 2018, 11:06

Hope this helps ;)

You might wanna check the "ToolbarWindow322" portion a bit with ahkspy because I'm still using win7.
Spoiler
me361
Posts: 2
Joined: 19 Sep 2018, 08:55

Re: Delete a folder without its content

20 Sep 2018, 08:25

Thanks! unfortunately its a bit to advanced for me and i cant get it working in Windows 10 :(
User avatar
NovaRanger
Posts: 68
Joined: 23 Oct 2014, 02:05

Re: Delete a folder without its content

20 Sep 2018, 10:13

Hello,
Thanks for the update..

The below code is the only one dependent on environment,

Code: Select all

ControlGetText, ALL_TEXT, ToolbarWindow322, ahk_class CabinetWClass
The ToolbarWindow322, ahk_class CabinetWClass could vary on your PC's windows..

Did you try using ahkspy and see what is being shown when you hover the cursor on windows filexplorer?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: filipemb, Google [Bot], mikeyww and 281 guests