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 6727239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:01:35+00:00 2026-05-26T10:01:35+00:00

Is it possible to modify the return code (I think it is also called

  • 0

Is it possible to modify the return code (I think it is also called errorlevel) of a command submitted in the Build events of Visual Studio?

I am running the command taskkill /F /IM MyApp.vshost.exe and I would like this command to return 0 when it is in fact returning 128.

  • 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-05-26T10:01:36+00:00Added an answer on May 26, 2026 at 10:01 am

    Redirect all output to a temp file and exit with code 0, in a batch file. This will effectively ignore any errors from taskkill:

    killit.bat:

    taskkill /F /IM MyApp.vshost.exe > %temp%\out.txt 2>&1
    exit /B 0
    

    Now invoke killit.bat in the build event.

    Update After hege posted his answer I figured just pasting the code from the batch file into the build event should work as well, since to my understanding build events in VC are always executed on the command line anyway. And indeed

    taskkill /F /IM MyApp.vshost.exe > %temp%\out.txt 2>&1 || exit /B 0
    

    as a build event works as well. The redirection is still required though.

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

Sidebar

Related Questions

In case of the following code: da.Fill(ds) Is it possible to view the return
Is it possible to edit the data returned from command.ExecuteReader, and then return that
On webpart-pages it is possible modify the contained webparts over the Web by using
Is it possible to modify the title of the message box the confirm() function
Is it possible to modify a registry value (whether string or DWORD) via a
Is it possible to modify/write data to an XML file without any server-side proxy(e.g.
Is it possible to modify/edit, already installed firefox addons? Where are the addons stored
Is it possible to modify the bluish style of a mobile application developed with
Does someone know if it is possible to modify the JVM settings at runtime
Does anyone know whether it's possible to modify the workflow actions of a SharePoint

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.