Bish25
Bish25

Reputation: 616

Copying a file using xcopy path invalid

I trying to copy from on file to another using a batch file, however i get the error in valid path.

SET DatabaseBackupPath=C:\Program Files\Microsoft SQL Server\MSSQL12.DBNAME\MSSQL\Backup
SET NewDatabaseBackupPath=‪‪C:\Users\USERNAME\Documents

xcopy "%DatabaseBackupPath%\%NewestFile%" "%NewDatabaseBackupPath%"

This is the ouput for %NewDatabaseBackupPath% = "ÔǬÔǬC:\Users\USERNAME\Documents"

Can someone explain why all these characters exist and a possible solution?

Upvotes: 0

Views: 525

Answers (1)

JosefZ
JosefZ

Reputation: 30093

There is doubled harmful character [U+202A] in line SET NewDatabaseBackupPath=… and its UTF-8 representation 0xE280AA i.e. decimal sequence 226, 128, 170 is the same as that ÔǬ string in OEM code pages

CP850 US & Western Eu
CP852 Central Europe
CP857 Turkic

Try Alt+226, Alt+128. Alt+170 in an open cmd window or check using my Alt KeyCode Finder script

Picture taken from Google Chrome Extension Unicode Analyzer

U+202A

Upvotes: 1

Related Questions