Skip to main content
Participant
October 21, 2023
Question

Can't delete XMP files

  • October 21, 2023
  • 1 reply
  • 259 views

Hi all,  I can't delete or remove XMP files anymore. Windows 11 gives the error message, Unable to remove, invalid file format.

Who can support me. 

This topic has been closed for replies.

1 reply

Stephen Marsh
Community Expert
Community Expert
October 21, 2023

Try Adobe Bridge (use the view menu to show hidden/invisible files).

 

An OS command line CMD.exe or PowerShell command code should also be able to delete such files if the Windows GUI has an issue.

 

An Adobe script could do this, but it sounds like a problem with your operating system, not an Adobe Photoshop or Bridge bug.

 

/*
Delete All XMP Files in Selected Folder.jsx
v1.0, 22nd October 2023, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-bugs/can-t-delete-xmp-files/idi-p/14176544
*/

#target photoshop

var theInputFolder = Folder.selectDialog("Please select the folder containing the XMP files to delete:");
if (confirm("USE AT YOUR OWN RISK!\rDo you really want to permanently delete all .xmp files at the top-level of the selected folder? There is no undoing this operation!")) {
    var theInputFiles = theInputFolder.getFiles(/\.xmp$/i);
    for (var i = 0; i < theInputFiles.length; i++) {
        theInputFiles[i].remove();
    }
}
app.beep();
theInputFolder.execute();

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html