Delete Folder your are in

Discuss and share scripts and script files...
Post Reply
Zodler
Posts: 55
Joined: 13 Jun 2011 02:54

Delete Folder your are in

Post by Zodler »

Here is what the script should do. You are inside a folder and run the script and it should delete the current folder and all inside it and go to the parent folder.

A
|----B <---you are here
|----C

After Delete

A <---you are here
|----C



I have written this:

delete 1, 1, <curpath> ;

It works and after confirmation, it deletes the folder you are inside.

My problem is at the end. At the end, the pane doesn't go to the parent. It goes sometimes to a sibling folder! Another child folder of the parent. Why is this? In Dopus when I delete the current folder, it goes automatically one up to the parent. How to achieve that here?

The problem is

After Delete

A
|----C <--- I am here!!!!!!!!!!!!!!


(I don't want to go up before deletion, because when the delete confirmation box shows I want to be able to see the files inside folder B.

admin
Site Admin
Posts: 66249
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Delete Folder your are in

Post by admin »

I added a new tweak (next version).

Code: Select all

TreeSelectParentOfDeleted=1
:arrow: How to tweak XYplorer.ini
http://www.xyplorer.com/xyfc/viewtopic.php?f=10&t=3543

admin
Site Admin
Posts: 66249
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Delete Folder your are in

Post by admin »

admin wrote:I added a new tweak (next version).

Code: Select all

TreeSelectParentOfDeleted=1
:arrow: How to tweak XYplorer.ini
http://www.xyplorer.com/xyfc/viewtopic.php?f=10&t=3543
PS: How does Win7 Explorer handle this? (XP Explorer acts as XYplorer without the tweak.)

Zodler
Posts: 55
Joined: 13 Jun 2011 02:54

Re: Delete Folder your are in

Post by Zodler »

I did a test as you asked. I opened both Windows 7 Explorer and XYplorer. In both I went into Folder B. I executed the script and XYplorer as I said it went into a sibling (Folder C). For Windows 7 Explorer, it went correctly into the parent (Folder A).

Zodler
Posts: 55
Joined: 13 Jun 2011 02:54

Re: Delete Folder your are in

Post by Zodler »

Thanks, so I have to wait for the next version?

Zodler
Posts: 55
Joined: 13 Jun 2011 02:54

Re: Delete Folder your are in

Post by Zodler »

In the meantime until next version I wrote this and use this. It does the same:

$p = <curpath> ;
delete 1, 1, $p ;
goto "$p\..";

admin
Site Admin
Posts: 66249
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Delete Folder your are in

Post by admin »

Zodler wrote:I did a test as you asked. I opened both Windows 7 Explorer and XYplorer. In both I went into Folder B. I executed the script and XYplorer as I said it went into a sibling (Folder C). For Windows 7 Explorer, it went correctly into the parent (Folder A).
OK, if Windows 7 goes to the parent I will default the tweak to ON.

Post Reply