开发者

Adding XCopy command through Post Build Event in Visual Studio 2008 for multiple commands

I wanted to add 2 simple XCOPY commands to a post build event for a class file in Visual Studio 2008.

However, Visual Studio doesn't want to run the command unless I've either run the command once from a command line, OR copied the specified files to the target directory first.

Is it possible to specify or suppress/default the /f flag without having to execute the commands first?

xcopy /y "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\TrainingProject\TrainingProject\bin\debug\TrainingProject.dll" "C:\inetpub\wwwroot\slxclient\bin\TrainingProject.dll"
xcopy /y "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Tr开发者_运维问答ainingProject\TrainingProject\bin\debug\TrainingProject.pdb" "C:\inetpub\wwwroot\slxclient\bin\TrainingProject.pdb" 

The PDB entry chokes if I have not already copied it manually.

Thanks.


Just don't include the filename in the target path:

if not exist c:\bar\bin md c:\bar\bin
xcopy /y c:\foo\bin\mumble.pdb c:\bar\bin

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜