Actually, I can reproduce this in a test app. Seems not to be related to the
number of lines, so I investigated the number of macros, and it also seems
not to be directly related. What it appears to be is a limitation on the
number of characters in the post build event? Seems to be the number of
characters post macro expansion.
For example, this will fail with a project at C:\...\Desktop\Test
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
xcopy "$(ProjectDir)..\..\..\..\test me.txt" "$(TargetDir)" /R /Q /Y
But will work with the same project at C:\Test.
If I add more lines to the project in the shallower path, then it will also
fail...
Performing Post-Build Event...
'x..\..\..\..\test' is not recognized as an internal or external command,
operable program or batch file.
Is this a known issue?
Thanks,
David.
"David Battams" <da******@hotmail.com> wrote in message
news:eR**************@TK2MSFTNGP09.phx.gbl...
Hi there,
I'm calling xcopy in a post build event to copy some runtime requirements
to the TargetDir of the application I am working on. Problem is that I only
seem to be able to have 9 calls to xcopy. If I make any more calls than
the 9, it will fail. I can call the same command 9 times, and the 10th will
fail, or I can call 10 different ones and it will fail on the tenth.
Basically it doesn't matter how I mix it up, but if I take a bunch of
xcopy commands that copy different files to the same location, no matter which
order and despite the fact each command works by itself or when 9 or less
commands are executed, if I go to 10 commands it fails. :-(
I tried to reproduce this in a new C++ app, copying "C:\test.txt" to the
TargetDir, but it seems I can call xcopy as many times as I like and it
will work in the test app.
What could be the problem in my application?
Regards,
David.