This is not programming question and is my first time asking a question, so I'm sorry if this is the wrong forum.
I am trying to copy files using a simple .cmd file. Some of the files are receiving the error:
The system cannot find the file specified.
I have determined that the issue revolves around the use of the percent sign in the name of the file. I cannot rename the files in question as they are linked with database entries.
Here is an example of the syntax being used to copy the file and the resultant entry in the log file.
The name of the cmd file is Copy_Docs_v2.cmd. Here is the command:
Copy "\\server\DATA\APP\TJSH1\9w%01!.DOC" "\\server\APP\Docs\filename.DOC"
What appears in the log file is:
Copy "\\server\DATA\APP\TJSH1\9wCopy_Docs_v2.cmd1!.DOC" "\\server\APP\Docs\filename.DOC"
The system cannot find the file specified.
The log file entries vary slightly depending on whether the filename contains a %2 or multiple percent signs in the name but they all receive the same error message.
So the question is how do you copy a file with a percent sign in the filename or is there a way to get the Windows command prompt to ignore percent signs in a command?