Can't delete file due to invalid file name

Page 2 of 2 FirstFirst 12

  1. Posts : 67
    Windows 7 Pro
    Thread Starter
       #11

    karlsnooks said:
    Robin,
    Is this file in the Pictures folder?
    You have given the name but not the path for the file.

    Try following:
    go to an elevated command prompt and enter following commands:
    CD /D %userprofile%\Pictures
    dir schmerafdruk*.*
    does you trouble file show up?

    Go To an Elevated Command Prompt


    Elevated command prompt = Run CMD.EXE as administrator
    WIN | type CMD.EXE | do not hit Enter |
    CTRL+SHIFT+ENTER keycombo| YES

    WIN is the key with the Microsoft flag on top.
    Oh sorry. The file is in the root of D: and there is no pictures folder, because there is no Windows installed on that drive since I only use it for storage.

    I still get this error: "The filename, directory name, or volume label syntax is incorrect".

    Using "dir Schermafdruk*.*" shows me that the file is present in D:.
      My Computer


  2. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #12

    Hi Robin,

    Try this:

    At an elevated command prompt, enter cd /d d:\ in order to switch to the D drive. Next, enter dir to verify the filename(s) of the file(s) you wish to delete.

    To delete the file, right-click in the command window and click Mark. Now, highlight the appropriate filename and press Ctrl + C to copy the information to the clipboard. At the command prompt, type del /f " and then right-click + Paste to enter the previously saved information (the filename). Finish by entering " (there should be no spaces between the " characters and the filename) and then execute the command. This should delete the file. Check by reissuing the dir command. Note that you may also use erase instead of del, and if you add the switch /p you will get a confirmation prompt. You will need to repeat this for each file that needs deleting. Copying the filename in this manner removes the possibility of errors creeping in when typing the name, as it is very easy to confuse some characters for others (such as O,o,0 and l,1,i,I to name a few). This misinterpretation of the characters in a filename can often give rise to the error you mention (what you type looks correct, but it isn't).
      My Computer


  3. Posts : 67
    Windows 7 Pro
    Thread Starter
       #13

    I've tried everything you guys suggested, but it just wouldn't work.

    I did find a different way to get rid of the file, which was not the easiest since I encountered some Linux related problems while booting, but it worked! Using a Xubuntu Live usb I could just right click and delete/open/rename/move the file. I had tried Linux virtual machines before since my mobo is UEFI and therefore does not like anything but Windows, but I had trouble sharing files with the machine.

    I will rep the ones that gave me some very interesting information, thanks guys!
      My Computer


  4. Posts : 2
    Windows 7 Home Premium 64-bit
       #14

    RobinSchouten said:
    I did find a different way to get rid of the file, which was not the easiest since I encountered some Linux related problems while booting, but it worked! Using a Xubuntu Live usb I could just right click and delete/open/rename/move the file.
    I tried all the DOS and Windows & suggestions here and on another forum and nothing worked. In the end, the only way I could get the file to go away was to open the folder on a Linux virtual machine (which was a bit of trick in itself, mounting the external HD) and delete it.

    Thanks, RobinSchouten, for that bit of advice!
      My Computer


 
Page 2 of 2 FirstFirst 12

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 21:05.
Find Us