-
This utility is designed for users who intent on needing to remove a file or file folder many times using brute-force methods.
-
This utility will watch for the specified file(s) and remove them upon their appearance instantly.
- User runs the
.bat - The
.batlaunches the.ps1 - The
.ps1actively searches for, and deletes the specified file(s) - The
.ps1quits when user closes or pressesCtrl+C
- User runs the
This utility consists of three components that work together:
-
Delete_Blocksi.bat
A Windows batch launcher that executes the PowerShell script and provides a simple user-facing console wrapper. -
Delete_Blocksi.ps1
The main PowerShell engine that:- Monitors specified directory paths,
- Logs all detected events,
- Attempts to delete specified files/folders
- Writes output to both console and a log file.
-
script.logA persistent plain-text log file automatically created in the same directory as the PowerShell script. It logs all action performed byDelete_Blocksi.ps1.
A minimal launcher intended to start the deletion workflow and display live logs from the PowerShell script. By clicking directly.
@echo off
title File Remover - Live Logs
echo Looking for files...
echo -----------------------------
powershell -ExecutionPolicy Bypass -NoExit -File "[PATH]"
echo -----------------------------
echo Script stopped. Press any key to exit.
pause >nul@echo offsuppresses command-echoing.- Sets window title: "File Remover - Live Logs".
- Prints:
"Looking for files...""Script stopped. Press any key to exit."
- Waits for a keypress before closing.
- The
.batfile does not actually call the PowerShell script in its current form. - The launcher requires for the user to find the file path of the PowerShell and replace
[Path]with the file path.
This script performs real-time monitoring and deletion of the files/folders. It logs every operation, including detections, failures, timestamps, and deletion outcomes.
$BlocksiPath = "[PATH]"
$TempPath = "[PATH]"These paths must be manually set to valid filesystem locations. The current version for the code supports two files to be deleted. It requires the user to find the file path of the file(s) they wish to delete and replace [Path] with the file path. Shall they choose to only delete one file, they may leave the other as-is without deleting anything.
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$LogFile = Join-Path $ScriptDir "script.log"$ScriptDiridentifies the folder containing the.ps1script.script.logis created or appended inside the same folder.
function Log($msg) {
$timestamp = (Get-Date).ToString("yyyy-MM-dd HH:mm:ss:fff")
$entry = "[$timestamp] $msg"
Write-Output $entry
Add-Content -Path $LogFile -Value $entry
}Features:
- Millisecond-resolution timestamps.
- Logs to both console and disk.
- All events, including errors, are written.
Write-Output "Watching for Files... Press Ctrl+C to end Script"This script is intended to run continuously in the background until manually terminated.
if (Test-Path $TempPath) {
Log "Temp detected."
try {
Remove-Item -Path $TempPath -Recurse -Force -ErrorAction Stop
Log "Temp deleted."
}
catch {
Log "Temp removal failed."
}
}
Start-Sleep -Milliseconds 1Operational Explanation
- Check if the folder defined in
$TempPathexists. - If present:
- Log
"Temp detected." - Attempt recursive forced deletion.
- Log
"Temp deleted."or"Temp removal failed."
- Log
- Script sleeps for 1 millisecond to prevent freezing, implying:
- This runs in a high-frequency monitoring loop.
- CPU usage is low, as it will only watch, unless a file that is specified is spotted
Stored in the same directory as Delete_Blocksi.ps1:
<ps1_directory>\script.log
Each entry follows:
[YYYY-MM-DD HH:MM:SS:fff] <Message>
- Log file is appended, never cleared.
- Automatically created if missing.
- Grows continuously while script is running.
- Windows 10 or 11
- PowerShell 5.1 or PowerShell 7+
- Administrator privileges are not required if specified file(s) are on the current user's. These files must also be saved to the current user's.
- Internet connection not required
The following placeholders must be replaced:
$BlocksiPath = "[PATH]"
$TempPath = "[PATH]"
and
powershell -ExecutionPolicy Bypass -NoExit -File "[PATH]"
- The system will touch any file paths specified
- It could accidentally delete wanted/needed files if specified by user
- Use at your own risk
- Un-ZIP the file
- These files shall be kept in the same folder when used
- Use Notepad
- Ctrl+R
- Notepad.exe
- Press enter
- Ctrl+O
- Navigate to directory containing file(s)
- Click on file or Shift+Click to select multiple files
- Press enter
- Edit files
- The file will run if the PowerShell window appears
Edit Delete_Blocksi.ps1 and set real filesystem paths for:
- Installation directory to monitor
- Any temporary file directory to monitor
Edit Delete_Blocksi.bat and set real filesystem paths for:
Delete_Blocksi.ps1
Open PowerShell and run:
powershell -ExecutionPolicy Bypass -File "[PATH]"The path shall be the file path for the Delete_Blocksi.ps1 file. Users could also run by double-clicking the .bat file.
The console will show timestamps and logs.
To view, open the log in Notepad using the instructions provided above, or double-click.
Detailed logs accumulate in:
script.log
... | Delete-Blocksi-Windows11 │ ├── README.md ├── BLOCKSI.md ├── LICENSE.md ├── SECURITY.md ├── Delete_Blocksi.ico ├── Delete_Blocksi.png ├── Delete_Blocksi.ps1 ├── Delete_Blocksi.bat ├── Delete_Blocksi (Shortcut, if created) └── script.log (created automatically)
A shortcut can be created that lauches the .bat file. This file could be customized with an icon. Users could use the ico file provided as the icon for this file or they may create their own. This shortcut can be stored on the desktop or be pinned to the taskbar. To create follow these instructions:
- Press Windows+E
- Navigate to the folder with all the other files
- Click New (top-left corner)
- Click Shotcut
- Type/Browse the location of the
.batfile - Press Next
- Rename if preferred
- Press Finish
To Change the icon:
- Right click on shortcut
- Press Properties
- Press Change Icon...
- If there is a pop-up, press Ok
- Click Browse
- Navigate to the folder with all other files
- Select the
.icofile - Click Open
- Click Ok
- Click Ok
1.0.0 Official Build | Stable Release