user3365047
user3365047

Reputation: 11

Unable to copy files using COPY on Windows 2003 Server with long name and special characters

I have thousands of files in a batch file which I need to copy so I prepare a batch file containing copy command as mentioned below. A few files fail to copy with the message "The system cannot find the file specified." These entries come from a database.

copy "G:\csdata\maximo\ATTACHMENTS\MM#2103806321038064-4’’&6’’X4’’X1500N-LINECHOKEVALVEMOD-4CPC.msg" g:\sample /Y copy "G:\csdata\maximo\ATTACHMENTS\Re-doPR70072095withaddinganotheritem21037549TAPE&HEADER-ASSY#THAB2317-70M–QTY2EA.msg" g:\sample /Y

As alternative to this, I then used VB script as mentioned below but when a file is missing at OS level the script stops, It should continue to copy next file instead:

Dim FSO Set FSO = CreateObject("Scripting.FileSystemObject") FSO.CopyFile "G:\csdata\maximo\ATTACHMENTS\FW91536140-WF3VB4754RPLPASSING18”-VB505LLHDRVLV.msg", "g:\sample\" FSO.CopyFile "G:\csdata\maximo\ATTACHMENTS\FW18VALVEFORLLPF1359361065881.msg", "g:\sample\"

please advise what is the best possible way?

Upvotes: 1

Views: 233

Answers (1)

Sun
Sun

Reputation: 2715

Maximo may allow you to upload/attach files that have characters that are more difficult to process in a batch file. For example, the double quote as part of the file name may confuse the COPY command into thinking that you want to copy G:\csdata\maximo\ATTACHMENTS\MM#2103806321038064-4 rather than the full file name.

Upvotes: 0

Related Questions