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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:58:53+00:00 2026-06-09T18:58:53+00:00

My goal is to create a simple msi package that is supposed to do

  • 0

My goal is to create a simple msi package that is supposed to do nothing but running a .bat script located in the same folder with the .msi. I don’t need to copy any files on target machine or create folders, etc. I tried to use Wix 3.5 with vb-script which will run .bat i need. The vb-code itself works perfectly, but inside .msi it acts in a strange way – i can see a message box with the ‘path’, i got no errors, but script doesn’t execute .bat.

 <Property Id="Launch">
  <![CDATA[
  Function Main()
    Set shell = CreateObject("WSCript.shell") 
    path = Session.Property("SourceDir") 
    MsgBox path
    shell.Run path & "sample.bat", 0, False
    Set shell = Nothing
    Main = 1
  End Function
  ]]>
</Property> 
<CustomAction Id="Die"
              VBScriptCall="Main"
              Property="Launch"                   
              Return="check"              
              Impersonate="yes"/>

  <InstallExecuteSequence>
     <Custom Action='Die' Before='RegisterProduct'> NOT Installed </Custom>  
  </InstallExecuteSequence> 

I also tried another way:

<Property Id='CMD'>cmd.exe</Property>
  <CustomAction Id='LaunchFile' Property='CMD' ExeCommand='[SourceDir]sample.bat' Return='check' Impersonate='yes'/> 

But if I put ‘notepad.exe’ in property – everythings works great, when I use ‘cmd.exe’ console opens and closes without executing my sample.bat. In case of ‘notepad.exe’, it shows the content of ‘sample.bat’. Could you guys help me out with this?

  • 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-09T18:58:54+00:00Added an answer on June 9, 2026 at 6:58 pm

    Well, that was easy… Actually, everything was ok, but .bat itself was calculating relative paths from %WinDir%\System32\ I just put CD %~dp0 as the first line of my .bat and it started to work properly.

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

Sidebar

Related Questions

My goal is to create a simple Win32 Console application that uses HunSpell to
Goal : Create a long running process from a python script. I started with
My goal is to create an entry form (addnew.php) that will allow me to
My goal is to create an executable that will start a shadow copied application.
I want to create a simple class that I can use and encode as
My goal is to create a log app, apart from my main app, that
I'm trying to create a simple function to do a status test. Goal is
I'm trying to create a simple search form in Rails, but I think I'm
My goal here is to create a very simple template language. At the moment,
I've created an object Chartblock that implements QGraphicsItem. My goal is to create a

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.