Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Double backslash in cmd directory handling

Due to sometimes empty variables within a cmd-script I get directory definitions with doubled backslashes (\\). Example:

SET "Mp3OutDir=%Mp3Root%\%AlbumDir%\%AlbumArtist1stChar%\%AlbumArtistSort_VDN%\[%Year%] %Album_VDN%"

leads, if %AlbumDir% is not defined by user within the procedure, to something like

mkdir "D:\Public\Music\Mp3CDRips\\G\Gabriel, Peter"

This seems to work without errors but I'm curious if a term like this is permitted by the cmd-interpreter.

Cheers, Martin

like image 210
cmdquestion Avatar asked Jan 12 '14 18:01

cmdquestion


1 Answers

The cmd interpreter seems to ignore extra back slashes in directory names. For example:

C:\>cd Windows\\\\\\\\\\\System32

This will still change the directory to C:\Windows\System32>.

So to answer your question, yes, a term like that is permitted by the cmd interpreter. As to why, I'm not sure.

like image 153
unclemeat Avatar answered Sep 21 '22 07:09

unclemeat