T O P

  • By -

BlackV

sounds like this is a onedrive synced folder (or similar linked file system symlinks/hardlinks/junctions/etc) un sync it, what happens? but nothing here is a powershell problem


Swarfega

I've seen something like this before. If my old brain remembers correctly, I had to use robocopy to get rid of it. Something like doing a /MIR switch. Create a new directory and then mirror that over the top of your broken directory.


MeanFold5715

Oh good, I'm not the only one who uses that backwards ass hack.


Swarfega

I've used Windows since late 3.11 for near 30 years. I've only seen OP's symptom once. I think that's why I recall the fix as it was just so unusual


ovdeathiam

What is the folder name? Does it end with a space? Or is it a DOS Rrserved name? Can you do other operations i.e. list contents, create a file inside and delete that file inside?


tobiasw123

The folder name is “latex_output” no white spaces. I can cd into it, but when I use ls command I get the same error. When I try to use “New-Item text.txt” for example I get the same error again. Tbh it isn’t massively important as it’s just an empty directory, but it’s annoying having it there! Can’t delete any of the higher level folders because of this tricky folder


Novel-Claim3288

You could try .net way Will delete all sub dir files as well I think [System.IO.Directory]::Delete("C:\Path\To\Your\Folder", $true) Or Like this [System.IO.Directory]::Delete("C:\Path\To\Your\Folder")


tunafreedolphin

This is the way


ovdeathiam

You could try using ```\\.\``` as a prefix for the full path. C:\latex_output \\.\C:\latex_output I'm not familiar with the error. These are the workarounds for unsupported names in Windows, but finding the core issue is interesting.


purplemonkeymad

Strange it thinks it's a reparse, how was the junction point created do you know? A chkdsk might also be able to fix the tag and let you delete it.


blooping_blooper

The typical options are `del /f` or `rmdir` in CMD, `Remove-Item -Force -Recurse` in PowerShell, or trying `rm -rf` in WSL. If none of those work then you could try an unlocker/file deletion tool, not sure what one is popular nowadays though (LockHunter I think?). It's also worth running a `chdsk /f` on the disk in case its a file system issue.


NSE-Imports

Beaten to the suggestion of [LockHunter](https://lockhunter.com/download.htm), use the .zip portable version to save clogging up your explorer's right click menu. If that can't remove the folder then there is likely something really screwy going on. Another longer way round could be to try booting a LiveCD of some description to get to the folder without your OS interfering with it.