Restore deleted items options

Suggestions and feature requests.
Post Reply
Message
Author
User avatar
Forez
Posts: 1333
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Restore deleted items options

#1 Post by Forez » 18.09.2021, 15:13

I would like to have a simple option of reverting the last delete operation

Assuming that my items are moved to the Recycle Bin and not deleted straight away, I wish I cold just pick an entry from the overall right click menu or click some icon placed on Favorite Toolbar or on the status bar and thus have automatically performed the equivalent of me:

1] opening the Recycle Bin

2] navigating manually in it to the latest items or filtering / sorting items deletion date

3] choosing the option of restoring them to the place of their last position

This would save me a lot of time and clicks as I often find myself [for whatever reason] deleting the wrong item(s) - thus repeating the mundane task of reverting yet another mistake



In the meantime: does anyone know of a BAT or PS1 script that can do this?
Last edited by Forez on 15.01.2023, 23:27, edited 7 times in total.

User avatar
Dreamer
Site Admin
Posts: 6132
Joined: 19.08.2007, 23:40

Re: Restore deleted items options

#2 Post by Dreamer » 18.09.2021, 15:46

Workarounds:

FreeCommander XE "not so obvious" settings - Page 2 - FreeCommander Forum
Dreamer wrote: 28.11.2019, 22:45 Here is the guide, how to use a condition for the Recycle bin, it's usable in Column profiles and Automatic views.

This way, if you open Recycle bin, or switch to tab with Recycle bin, details view and sorting by Date Deleted - also folders will be used automatically, so the last deleted item will be first in the list, even if it's a folder.
Marek wrote: 26.11.2019, 21:28 If you want to define column profile for Recycle Bin:
- open the Recycle Bin in the left pane
- switch view to details
- open popup menu with Shift+F1 (left pane with recycle bin is active)
- select "Column profiles"->"Add current column profile specific to folder"
- define the name for the new profile: RecycleBin
- open Tools->Settings and select "Column profiles/Automatic view" in the tree
- select new created profile "RecycleBin" and click on "Define columns" button
- click the button "Define columns" and set the columns as you like
- save the setting
To add the Recycle bin to Automatic views:

- create "RecycleBin" item
- add any condition, e.g. empty <sub>
- for View "type:" select "Details"
- for "Columns profile:" select "RecycleBin"
- for "Sort on:" select "Date Deleted" and click the button Descending (if you want to sort items by date deleted)
- apply and save settings
- close FreeCommander

- open FreeCommander.ini file in any text editor
- search for "[FcDetailedViews_RecycleBin"
- copy the line "Condition=..." below to clipboard (Ctrl+C)
- open FreeCommander.views.ini file in any text editor
- search for "Name=RecycleBin"
- replace the line "Condition=..." few lines below with the text from clipboard (Ctrl+V)
- save the file
- start FreeCommander
Use the guide in that post, then you can create recycle bin tab, or just click the splitter recycle bin, it should be opened in fc, in the current tab, then you can right click the last deleted item, it should be on top, and select "restore", it's the first context menu item. Another way is to drag&drop that file to other panel, or Ctrl+X, Ctrl+V. It's possible also to use F6 to move to other panel, but in this case the name is not preserved.

User avatar
Forez
Posts: 1333
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Restore deleted items options

#3 Post by Forez » 25.09.2021, 15:53

Dreamer wrote: 18.09.2021, 15:46 Workarounds:

FreeCommander XE "not so obvious" settings - Page 2 - FreeCommander Forum
Dreamer wrote: 28.11.2019, 22:45 Here is the guide, how to use a condition for the Recycle bin, it's usable in Column profiles and Automatic views.

This way, if you open Recycle bin, or switch to tab with Recycle bin, details view and sorting by Date Deleted - also folders will be used automatically, so the last deleted item will be first in the list, even if it's a folder.
Marek wrote: 26.11.2019, 21:28 If you want to define column profile for Recycle Bin:
- open the Recycle Bin in the left pane
- switch view to details
- open popup menu with Shift+F1 (left pane with recycle bin is active)
- select "Column profiles"->"Add current column profile specific to folder"
- define the name for the new profile: RecycleBin
- open Tools->Settings and select "Column profiles/Automatic view" in the tree
- select new created profile "RecycleBin" and click on "Define columns" button
- click the button "Define columns" and set the columns as you like
- save the setting
[...]
[...]
Funny thing: I must have added some time in the past a Column Profile for Recycle Bin as I already have it in my Column Profiles / Automatic Views section along with two others. And these two others I can select as I can see them on the list list along with the >>fc_default_view<<. But I cannot see thus use the profile for RC as it is present only in options. [So not so funny now]

User avatar
Dreamer
Site Admin
Posts: 6132
Joined: 19.08.2007, 23:40

Re: Restore deleted items options

#4 Post by Dreamer » 25.09.2021, 18:01

I don't understand, how you can't see them? When using auto views they can be activated automatically, so they don't have to be activated manually.

Perhaps you mean this known bug?

825 - Not all column profiles are in the list - FreeCommander Forum

User avatar
Forez
Posts: 1333
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Restore deleted items options

#5 Post by Forez » 01.10.2021, 13:39

Dreamer wrote: 25.09.2021, 18:01 [...]
Perhaps you mean this known bug?

825 - Not all column profiles are in the list - FreeCommander Forum
Apparently yes: I have this profile for Recycle Bin with its "condition" set to <pidl> visible in "Column profiles" tab editing window- but when I want to switch to it from a list it is not present

All in all this is giving me a headache with the end result of me having to every time after making an accidental deletion;
1] manually open Recycle in
2] change to detailed view
3] sort by date of deletion

User avatar
Dreamer
Site Admin
Posts: 6132
Joined: 19.08.2007, 23:40

Re: Restore deleted items options

#6 Post by Dreamer » 01.10.2021, 21:33

Forez wrote: 01.10.2021, 13:39All in all this is giving me a headache with the end result of me having to every time after making an accidental deletion;
1] manually open Recycle in
2] change to detailed view
3] sort by date of deletion
As I said, you can set the column profile and automatic views and then you can skip steps 2 and 3, it works, guide is above.

User avatar
Forez
Posts: 1333
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Restore deleted items options

#7 Post by Forez » 15.01.2023, 23:24

Forez wrote: 18.09.2021, 15:13 [...]
In the meantime: does anyone know of a BAT or PS1 script that can do this?
Oh, I do!:

Code: Select all

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "explorer.exe shell:RecycleBinFolder", 9

WScript.Sleep 1111

WshShell.SendKeys "^z"
WshShell.SendKeys "%{F4}"
Just save this in a file with VBS extension and you are ready to go. Your welcome
Last edited by Forez on 11.02.2023, 11:55, edited 1 time in total.

User avatar
Forez
Posts: 1333
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Restore deleted items options

#8 Post by Forez » 15.01.2023, 23:27

Dreamer wrote: 18.09.2021, 15:46 [...]
Use the guide in that post
[...]
I do not understand the step

copy the line "Condition=..." below to clipboard (Ctrl+C)

from it. Below... what or where / which? I have like a dozen Condition= entries in my

C:\Users\YOUR-USER-NAME\AppData\Local\FreeCommanderXE\Settings\FreeCommander.ini

file

User avatar
Dreamer
Site Admin
Posts: 6132
Joined: 19.08.2007, 23:40

Re: Restore deleted items options

#9 Post by Dreamer » 11.02.2023, 12:49

It's in the previous post already, step before, you need to search for "[FcDetailedViews_RecycleBin", then "Condition=..." is just below.

Anyway, the post is updated already, easier way can be used, here is the link:

https://freecommander.com/forum/viewtop ... 986#p30986

User avatar
Forez
Posts: 1333
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Restore deleted items options

#10 Post by Forez » 15.02.2023, 18:19

So I did do the instructions from https://freecommander.com/forum/viewtop ... 986#p30986

for
If you want to define column profile for Recycle Bin
and
To add the Recycle bin to Automatic views
and finally have items in Recycle Bin sorted always in a way that the last deleted one is at the top - which I what was after


But:

A] In order to also always see my Recycle Bin with Detailed View mode already applied to it I need to check

Tools > Settings > View > Column profiles/Automatic views > Auto selectable views > Switch view mode automatically on folder change

which has a huge side effect of this automation being applied also to every other folder / Tab - which renders it totally counterproductive, because when cycling through Tabs they constantly get changed to <Default view>, not remembering a temporary change. And that makes it unusable [unless every other folder gets its own settings] - and thus still requiring from me a manual change to Detailed View mode when I open the Recycle Bin folder

B] Is there a way to hard lock the width of Columns for all Automatic views or just for one [the Recycle Bin one in this case]? I want my Recycle Bin to always open itself with the same widths applied to its Columns - but sometimes I need to manually change them e.g. to see a very long path in its entirety. Right now whenever I change width by dragging edge of a Column such change gets remembered for the next opening - and I do not want it to be remembered but taken out from my initial Settings

C] Is there a way to make the Column of Date Deleted be always the first one? I can make it the first during a session, when closing and re-opening Tabs - but it is not remembered when I close and re-open FreeCommander, yet again requiring from me a manual intervention

User avatar
Forez
Posts: 1333
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Restore deleted items options

#11 Post by Forez » 16.12.2023, 19:30

Well?

Karol
Posts: 965
Joined: 19.08.2007, 12:05

Re: Restore deleted items options

#12 Post by Karol » 16.12.2023, 22:33

A] In order to also always see my Recycle Bin with Detailed View mode already applied to it I need to check
Tools > Settings > View > Column profiles/Automatic views > Auto selectable views > Switch view mode automatically on folder change
If you have already created column profile for recycle bin - simply move the profile in the list of profiles to the top of the list.
You do not need to activate Auto selectable views.
C] Is there a way to make the Column of Date Deleted be always the first one? I can make it the first during a session, when closing and re-opening Tabs - but it is not remembered when I close and re-open FreeCommander, yet again requiring from me a manual intervention
It seems to work now even after closing and opening FreeCommander. If you lock the tab with the recycle bin then the sorting is saved too.


Shortcut Shift+Ctrl+(Num+) is useful for auto adjust column sizes.

User avatar
Forez
Posts: 1333
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Restore deleted items options

#13 Post by Forez » 04.01.2024, 12:00

I have applied the same method as discussed here https://freecommander.com/forum/viewtop ... 325#p42336 - and finally it seems to be working as I want it, i.e. with automatically applied sort order from the newest deleted items to oldest ones

But I do need to use the

Column profiles > Profile settings... > Auto selectable views > Switch view mode automatically on folder change

for it


Thank you

User avatar
Forez
Posts: 1333
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Restore deleted items options

#14 Post by Forez » 04.01.2024, 12:11

Nevertheless the proposition from my initial post of having
Forez wrote: 18.09.2021, 15:13 a simple option of reverting the last delete operation
[...]
is still valid, as that VBS script workaround of mine
Forez wrote: 15.01.2023, 23:24 [...]

Code: Select all

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "explorer.exe shell:RecycleBinFolder", 9

WScript.Sleep 1111

WshShell.SendKeys "^z"
WshShell.SendKeys "%{F4}"
[...]
is not always working as what it performs is an overall un-do action and not precisely an un-delete


For example Mozilla Thunderbird has the option of

Edit > Undo Delete Message

which I use swiftly all the time whenever I make a stupid mistake. [And yes- I know that Thunderbird operates on somewhat closed internal database thus tracking user steps on items is one probably easier and in whole different way than in Windows at large - but I just wanted to illustrate what I mean and show a real case scenario used by people other than me]

User avatar
Forez
Posts: 1333
Joined: 30.01.2016, 12:05
Location: In front of a PC monitor

Re: Restore deleted items options

#15 Post by Forez » 07.01.2024, 21:48

Forez wrote: 04.01.2024, 12:11 [...]
For example Mozilla Thunderbird has
[...]
And here is a discussion about un-do option on forum of Everything: https://www.voidtools.com/forum/viewtop ... 531#p62531

But what is more important: Everything has an un-delete feature available in it under

Edit > Undo Delete

and even gives access to a list of performed deletions under

Edit > Undo History...

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests