0

I have copied some data from my Linux machine to my external hard disk. When I want to read some files on my Windows machine, I can't open it. I get the below error

The specified path does not exist

On the other hand I can't rename or copy the same file, with error

The file name you specified is not valid or too long

I have tried to use rename function in command prompt (with and without quotation marks):

rename "Long Name of The File.pdf" "short.pdf"

but I get this error (I don't know why?):

The syntax of the command is incorrect

Can you please help me?

phuclv
  • 26,555
  • 15
  • 113
  • 235
user3616359
  • 113
  • 5

2 Answers2

2

Without quotation marks or escape characters it won't work, because how can cmd knows which belongs to the original file name and which belongs to the new name? Will ren old name new name renames a file named old to name new name or a file named old name new to name or...?

Typing by hand might not work either because there may be some hidden or special characters in the file name which you can't type on keyboard. Better type a few characters of the file name and press Tab ↹ for auto-correct until the correct name appears.

If it doesn't work, probably because your path is too long. Rename the folders before the file to make it shorter, or map the containing folder to a drive using subst or disk manager mount. For more ways read this and this.

You can also try renaming with the short name of the file if it's available. Run dir /x to see and check for the short name of the file, then run ren shortn.ame new.name

If it still doesn't work, there may be some special characters in the file name that are forbidden in Windows like /\:*"?<>|. It might be easier to just boot to Linux and rename it.

Further reading:

phuclv
  • 26,555
  • 15
  • 113
  • 235
  • I alway use tab for autocorrect. It seems that file name is wrong. It is not to long, since I can access other files with longer names (together with Folder names). I can't also see special characters forbidden by windows (space and -). – user3616359 Sep 07 '15 at 10:08
  • I also see that in Properties/Security there are no any relevant information. – user3616359 Sep 07 '15 at 10:13
  • You can't simply see all the characters as not all is viewable. And space and `-` is not forbidden by Windows but things like `:?*\/`... are not allowed – phuclv Sep 07 '15 at 10:35
  • Yes. I realized that some special characters are included. The thing that I do is to change name in linux and copy it. However I will try to change everything in windows, but none of proposed methods are not working. – user3616359 Sep 07 '15 at 11:54
  • It's almost impossible to do it in Windows. The easiest way is to use a Linux boot disk and rename it. Did you check the links above? If it still give errors you must give more detail – phuclv Sep 07 '15 at 12:20
  • I have tried with 7zip, with using short filenames version, and nothing works. The error was "The filename, directory name, or volume label syntax is incorrect" It seems changing name in linux is the best option. – user3616359 Sep 07 '15 at 12:44
0

Data is damaged . Because buffer data not wrote in disk. I think some data has been lost.

Now the best way is you scanning and fixing external hard disk with windows tools.

enter image description here

windows error checker can fix some errors.

A1Gard
  • 101
  • 2