How to execute a .BAT file (batch script) during or automatically after a Visual Studio Created Install/Setup Program?

Hello everyone,

I have created an installation "Setup Wizard" using Visual Studio 2003 for my C++ application. I have created a .BAT batch script that basically runs some command prompt commands to create a new user and a password for that user.

Currently the Install program just places the .BAT file on the users desktop for them to run after installation. It doesn't automatically run it after or during the installation.

How can I make it so that it either executes the .BAT file during or after the installation of my C++ program?

Again please note I'm using the standard Visual Studio 2003 "Setup Wizard" to create an installation/setup program that installs my C++ program on the users PC.

Thanks in advance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I have VS 2005, hopefully in VS 2003 this is the same.
In Solution Explorer select project item, clock "Properties" tab. Properties contain PostBuildEvent - specifies any commands to execute after the build ends.
VirtueTechAuthor Commented:
I checked and I don't see it. Looks like it might be VS 2005 only. Too bad...that would have been perfect.

Thanks for the reply.

Anyone else have an idea?
Eduard GherguLeader SibiuCommented:

You can perform the following steps in order to do what you want. The problem is that only .exe, .dll, .vbs and .js files are supported but not .bat ones.
1. Select the setup project name;
2. In the Solution Explorer toolbar you'll find some new buttons. Click on the Custom Actions Editor.
3. In the Custom Actions window select Install node of tree
4. Go to Action menu and select Add Custom Action
5. Select Application folder from the combobox labeled Look in
6. Add file
7. Select All files, the click Add File
8. Browse and select the desired file
9. Build your solution.

So, you have to create a .vbs file instead of your .bat one

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
>>Currently the Install program just places the .BAT file on the users desktop for them to run after installation. It doesn't automatically run it after or during the installation.

You can also select 'User's desktop' instead of Application folder in step 5.

You would be able to run the batch file itself during the installation if you choose the file type as 'All files'
VirtueTechAuthor Commented:
Thanks guys....going to give it a shot tonight
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual C++.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.