简体   繁体   中英

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM