[Solved] How to delete a file with zero byte created accidentally with name "Call" on Windows ?
Posted: 08 Jun 2021 02:50
How to delete a file with zero byte created accidentally with name "Call" ?
I'm facing with this issue that i couldn't figure it out until now ?
I tried with command Del but no chance.
I tried also to remove the directory which contains this file "Call"
I tried with Powershell too :
EDIT : Problem is Solved here
Solution Provided by Compo on stackoverflow thanks to him :
Trailing spaces are not valid in Windows,I tried to delete it like this:
I'm facing with this issue that i couldn't figure it out until now ?
I tried with command Del but no chance.
Code: Select all
@echo off
set "targetdir=C:\FolderDir"
for /f "delims=" %%a in ('dir/s/b/a-d "%targetdir%\*.*"') do ( if %%~Za equ 0 echo %%~na>>results.txt && del "%%~a" )
Code: Select all
RD /S /Q [ParentFolder with file Call Inside]
Code: Select all
Get-ChildItem -Path "C:\MyFolderDir" -Recurse -Force | Where-Object { $_.PSIsContainer -eq $false -and $_.Length -eq 0 } | remove-item
Solution Provided by Compo on stackoverflow thanks to him :
Trailing spaces are not valid in Windows,I tried to delete it like this:
Code: Select all
Del /A /F "\\?\C:\Users\Hackoo\Desktop\Scripting\Call "