Double backslash in cmd directory processing

Because of the sometimes empty variables in cmd-script, I get directory definitions with double backslashes (\\). Example:

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

results if% AlbumDir% is not defined by the user as part of the procedure, something like

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

This seems to work without errors, but I'm curious if this interpreter is allowed by the cmd interpreter.

Cheers, Martin

+8
cmd batch-file backslash
source share
1 answer

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

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

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

So, to answer your question, yes, a term like this is allowed by the cmd interpreter. Why am I not sure.

+3
source share

All Articles