it may be that sqlcmd thinks the -D flag is meant for it, when in fact it is internal to the query passed on the cmd line. This would be a bug in sqlcmd's cmd line parsing code.
Also it seems to me your quotes might be confusing it, because you have double quotes inside your query. Try replacing "D:\MSSQL\Backup" with D:\MSSQL\Backup, and "BAK" with BAK.
Another thing to try would be to put the query in a file (query.sql) and then pass it to sqlcmd with the -i flag.