Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9074079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:33:32+00:00 2026-06-16T18:33:32+00:00

i want to make VS copy the .lib-file it created after the build process

  • 0

i want to make VS copy the .lib-file it created after the build process to a specific folder.
So i went to the project config, post-build event, and entered the following command:

if exist $(TargetPath)
xcopy "$(TargetPath)" "C:\Users\Incubbus\Documents\Visual Studio 2010\My Libraries\z.lib" /Y

But instead of copying the process fails after i click “build” and i receive the following error:

error MSB3073: The command “if exist
C:\Users\Incubbus\Documents\Visual Studio 2010\My
Libraries\MyNetWorkProject\Debug\IncNetworkLibD.lib xcopy
“C:\Users\Incubbus\Documents\Visual Studio 2010\My
Libraries\MyNetWorkProject\Debug\IncNetworkLibD.lib”
“C:\Users\Incubbus\Documents\Visual Studio 2010\My Libraries\z.lib” /Y

:VCEnd” exited with code 2.

I am also wondering about the :VCEnd in the command-string of the error message <- Maybe this is the reason? How to get this solved?

Any help and hints would be happily consumed :)…

partial solution:

EDIT: it looks like the renaming part (Inc.lib to z.lib) makes trouble, when xcopy asks whether this is a file or a directory…it works when i just copy the originally named file to a directory instead of copying renamed

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:33:33+00:00Added an answer on June 16, 2026 at 6:33 pm

    Xcopy documentation says the following:

    Specifying whether Destination is a file or directory
    If Destination does not contain an existing directory and does not end with a backslash (\), the following message appears:

    Does destination specify a file name 
    or directory name on the target 
    (F = file, D = directory)? 
    

    Press F if you want the file or files to be copied to a file. Press D if you want the file or files to be copied to a directory.

    You can suppress this message by using the /i command-line option, which causes xcopy to assume that the destination is a directory if the source is more than one file or a directory.

    You need the opposite, but there is no such switch.

    The solution is proposed here: https://stackoverflow.com/a/4283533/532647.

    It is suggested to prepend the xcopy command with echo f | prefix, which basically does the following: it simulates a user pressing f key when xcopy asks.

    So your command should look like:

    if exist $(TargetPath)
    echo f | xcopy "$(TargetPath)" "C:\Users\Incubbus\Documents\Visual Studio 2010\My Libraries\z.lib" /Y
    

    Operator | just pipes the output of echo f (== f) into xcopy command and it is read when appropriate. More information about output redirection here: http://ss64.com/nt/syntax-redirection.html.

    UPDATE:
    As Govert points out, this hack won’t work under a localized version of Windows.
    However, another hack will work:

    xcopy D:\file.zip c:\renamedFile.zip*
    

    Appending destination file name with an asterisk * makes xcopy not ask whether destination is a file or a directory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a folder under version control. I want to make a copy of
I want to make a real backup copy of a file with all the
I have a simple makefile project where I just want make install to copy
I want to add copy and paste to my application but make it available
I want make datetimepicker in my project. Using jquery how it is possible? I
I have libTestLibrary.so library and I want add it to Android-emulator's lib folder. How
I want to make changes to a file in my repo, then force git
When I want to make a copy of a database, I always create a
I want to make a backup of menu.vim using the copy command: exe '!cp
I have a database with 2 tables I want to make a copy of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.