Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello!
I've made a program that scrambles and deletes files. When the program starts, it reads the contents of a txt file containing the full paths and names of files to be wiped. The txt file is called "fordeletion.txt"
I can use the scrambling program itself to manually add files to this txt file, but I want to be able to right-click on any file in Explorer and click on an option "Mark for deletion". Ideally, this would add the full path and name of the file to a new line in the "fordeletion.txt". I'm guessing this can be achieved using a batch file?
Unfortunately I don't know anything about batch files! If somebody can tell me the code that the batch file would need, I'd be very grateful. Ideally, I need the batch file to add the right-clicked file's path and name to a new line in the "fordeletions.txt".
All help gratefully appreciated!
Thanks in advance,
Seymour.

Sorry, but what you wish to achieve is far beyond the plain capabilities of batch files.
A batch file could be invoked by right clicking the file name from Explorer, but that association requires a "Shell Extension" that means to add registry entries.
Duties well known by programmers, but not in the domain of batch scripting.

I'm aware I need to change the Folder Options in XP, to add a new option in context menus. I know how to do that.
It's the adding the file's name to a text file that is stumping me!

Well, if you are so expert in setting up shell extensions, here just a simple command to add the full path/name of the file right clicked, inspired by the well known Open, Print and so on items in the contextual menu:
C:\Windows\System32\Cmd.exe /C @Echo %~f1 >> fordeletion.txt
where fordeletion.txt would be prefixed by its full path.
I coded the command using the full path expansion for the %1 (%~f1) variable to catch its absolute address, but I don't know if that format is allowed in contextual menu settings.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |