Question

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

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top