E. Rodriguez
E. Rodriguez

Reputation: 717

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\TrainingProject\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.

Upvotes: 2

Views: 18253

Answers (1)

Hans Passant
Hans Passant

Reputation: 942187

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

Upvotes: 7

Related Questions