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

  • Home
  • SEARCH
  • 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 6021533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:43:37+00:00 2026-05-23T03:43:37+00:00

In a Setup project the executable files such as .exe , .dll , .js

  • 0

In a Setup project the executable files such as “.exe , .dll , .js , .vbs” are acceptable but there is no way to run a .bat file in a Custom Action.

The question is how to run the *.bat files during installation?

  • 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-23T03:43:38+00:00Added an answer on May 23, 2026 at 3:43 am

    Well, after much searching and trial and error I have solved this. I’m not sure if this is the best way, but it works.

    Here’s the scenario: I have an application I would like to deploy via a Visual Studio Setup project. In addition to my application files, I would like to create a subdirectory in the target directory that contains a batch (.bat) file. I would like this file to run at the end of the installation process.

    Here’s what you do:

    1. Create a setup project and configure as you normally would, including the subdirectory in which you’ll place your batch file (you can just place it in the Application Folder directly if you don’t want it in a subdirectory).
    2. In the "File System" view (right-click on the project in Solution Explorer->View->File System), add the batch file you want to execute and cmd.exe (C:\Windows\System32\cmd.exe)
    3. Open the "Custom Actions" view (right-click on the project in Solution Explorer->View->Custom Actions)
    4. Right-click on "Commit" and choose "Add Custom Action"
    5. Navigate to and select cmd.exe.
    6. Open the properties panel for the newly created custom action.
    7. Delete /Commit from the Arguments property.
    8. Enter: /c "[TARGETDIR]subdirectoryname\batchfile.bat" in the Arguments property, where subdirectoryname should be replaced by the name of your subdirectory (if you put the batch file in a subdirectory like I did… if you didn’t, the value should be /c "[TARGETDIR]batchfile.bat") and batchfile.bat should be the filename of your batch file.

    That’s it. The batch file will now be executed once the rest of the installation process is completed.

    Here’s an example for the sake of clarity:

    My batch file: blah.bat
    My subdirectory: mydir

    The value of the Arguments for my custom action targeting cmd.exe would then be

    /c "[TARGETDIR]mydir\blah.bat"

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

Sidebar

Related Questions

The .NET Setup project seems to have a lot of options, but I don't
Possible Duplicate: VS2008 Setup Project: Shared (By All Users) Application Data Files? Please can
I am considering helping an open-source gaming project with creating their setup file. The
I just built a setup.msi file using the Web Setup Project template within Visual
I have a setup project created by Visual Studio 2005, and consists of both
I've Added a setup project to my solution (didn't use the wizard) I then
I have a setup project for my C# program, and this setup project has
I have created a setup project using Visual Studio 2008. After the application is
I created the setup project for the application and I can see that the
I have a windows setup project that installs a service. All works well except

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.