Code: Select all
del /q C:\Test
So how can I delete files not so permanently?
[And no: I do not want to use a post-mistake workaround of using recovery tools]
Moderator: DosItHelp
Code: Select all
del /q C:\Test
What does the present in itnpocmaka_ wrote: ↑19 Jul 2023 02:39try this: https://github.com/npocmaka/batch.scrip ... leteJS.bat
Code: Select all
"Usage (prints with default printer a file if possible)"
OK
Hold your horses
Code: Select all
cd "C:\My Portables\Binit\"
start "" /b Binit.exe "M:\Music\*.WAV"
You'd use it like any CLI program. I mean, that's what you're doing in the OP.
? Your OP describes a CLI usage but now you're wanting to replace the native Windows functionality of the delete key and context menu... with a program that does the same thing (ie: both send files to the Recycle Bin)? I don't understand.DOSadnie wrote: ↑19 Jul 2023 10:09I would have to write and always be running e.g. AHK script that would replace pressing of Delete key in every program of mine that happens to have file handling abilities with the usage of this Binit; plus I would need to add a fail-safe question for it. And then I would also need to add Binit [also with a fail-safe step] to my right click menu, right?
Haha. THis is something that I've copied from another script. Thanks. I'll update it. To use it you need just to pass a file or folder location as an argument:DOSadnie wrote: ↑19 Jul 2023 10:09What does the present in itnpocmaka_ wrote: ↑19 Jul 2023 02:39try this: https://github.com/npocmaka/batch.scrip ... leteJS.bat
suppose to have anything to do with deletion of items and Recycle Bin?Code: Select all
"Usage (prints with default printer a file if possible)"
OK
But how can I effectively use Binit also outside of a BAT script, i.e. incorporate it to a daily and on the spot usage?
I would have to write and always be running e.g. AHK script that would replace pressing of Delete key in every program of mine that happens to have file handling abilities with the usage of this Binit; plus I would need to add a fail-safe question for it. And then I would also need to add Binit [also with a fail-safe step] to my right click menu, right?
Code: Select all
call deleteJs.bat c:\myfolder\myFile.txt
Code: Select all
@echo off
set "MyFile=C:\Test\1.txt"
mshta "javascript:new ActiveXObject('Shell.Application').NameSpace(10).CopyHere('%MyFile:\=\\%');close()"
Code: Select all
*.WAV
I also having read carefully more than once what I had written do not understand what was it that I was after back then
Code: Select all
$LIST_OF_FOLDERS_TO_APPLY_THIS_SCRIPT = @(
"M:\Music\",
"X:\Music New\",
"Z:\Backups\"
)
$EXTENSION_OF_FILES_TO_REMOVE = "*.WAV"
function DELETE-FILES($FOLDER) {
$THIS_WILL_BE_REMOVED = Get-ChildItem -Path $FOLDER -Filter $EXTENSION_OF_FILES_TO_REMOVE -File -Force -ErrorAction SilentlyContinue
foreach ($file in $THIS_WILL_BE_REMOVED) {
$shell = New-Object -ComObject Shell.Application
$shell.Namespace(10).MoveHere($file.FullName)
}
$ALL_SUBFOLDERS = Get-ChildItem -Path $FOLDER -Directory -Force -ErrorAction SilentlyContinue
foreach ($EACH_SUBFOLDER in $ALL_SUBFOLDERS) {
DELETE-FILES $EACH_SUBFOLDER.FullName
}
}
foreach ($FOLDER_PATH in $LIST_OF_FOLDERS_TO_APPLY_THIS_SCRIPT_TO) {
DELETE-FILES $FOLDER_PATH
}