>>>File names with spaces are generally a PITA in CMD files. If there's a chance you could get the file named something like "Detail_with_Text_Report.BAI2" that would be easier to handle. Nevertheless the following should work:
>>>
>>>copy %srce%*.bai* %trgt%
>>>
>>
>>Аhem...
>>
>>
>>copy "%srce%*.bai* "%trgt%"
>>
>
>I tested interactively before I posted. I had a folder with some .txt files that started with the letter "c", some of which included spaces in the file name. I ran
>
>copy c*.txt {destination folder}
>
>All the files, including the ones with spaces, copied as expected.
My correction was only for the case when %trgt% itself contains spaces.
>I also thought about wrapping with double quotes, dunno how that would affect things. I think you missed one in your post, anyways ;)
I thought you put it there but forgot the first one... now I see that that was an asterisk. Actually I don't know why I keep UT on such a small font (now I know: to prevent horizontal scrolling). There... and everything still fits.
>Just this afternoon I ran into a case where double quotes were needed. If you're willing to put plaintext credentials in a CMD file you can automate drive mapping to remote machines not on the same domain e.g.
>
>NET USE F: \\SomeServer\SomeShare MyPassword /USER:SomeDomain\SomeUserAccount /persistent:y
>
This afternoon it turned out the password ended in "?". The NET USE command kept throwing errors about bad account name or password. After I wrapped the password in double quotes, all was well.
The eternal question, just like all the formats where data are to be represented as text, is still "what are the data and what are the delimiters between data and metadata".
Waiting for a password with a quotation mark in it...