Microsoft KB Archive/271405

= PRB: Batch Files Do Not Run as Post Executables in Setup Routine =

Article ID: 271405

Article Last Modified on 5/12/2003

-

APPLIES TO

 Microsoft Visual FoxPro 5.0 Standard Edition, when used with:  Microsoft Windows NT 4.0

 Microsoft Windows 2000 Standard Edition  Microsoft Visual FoxPro 5.0a, when used with:  Microsoft Windows NT 4.0

 Microsoft Windows 2000 Standard Edition</li></ul> </li> Microsoft Visual FoxPro 6.0 Professional Edition, when used with:  Microsoft Windows NT 4.0</li></ul>

 Microsoft Windows 2000 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q271405

<div class="symptoms_section">

SYMPTOMS
When you try to run a batch file as a post executable in an setup package built by Visual FoxPro's Setup Wizard, the batch file does not execute if it is run on a Microsoft Windows NT 4.0 or a Microsoft Windows 2000-based operating system. The batch file does execute properly if it is run on Microsoft Windows 9X-based operating systems.

<div class="moreinformation_section">

MORE INFORMATION
In step 4 of the Visual FoxPro Setup Wizard, there is a Post-Setup Executable text box. The file specified in this box runs at the end of the setup package created by the wizard. This file is usually an executable (.exe) or batch (.bat) file. An .exe executes at the end of the setup routine regardless of what operating system is running, but a .bat file does not execute on NT 4.0 or Windows 2000-based operating systems.

NOTE: .CMD files, an alternative to batch files on Windows NT and Windows 2000 computers, also do not run as Post-Setup Executables.

Steps to Reproduce Behavior
<ol>  Create a batch file called Do_Batch.bat in a new folder, and then add some DOS commands, such as: CD C:\ MD Mybatch If the batch file executes properly, a folder called Mybatch is created on the C: drive.

</li> Create a Visual FoxPro executable in the same folder as the batch file. The .exe can be small; a .prg with a WAIT WINDOW command will do.</li> Run the Visual FoxPro Setup Wizard, pointing to the files that are in the folder created in step 1. Type the file name Do_Batch.bat in the Post-Executable text box in step 4.</li> Select Finish in step 6 of the Setup Wizard, allow the setup package to be created, and then run Setup.exe to start the installation. If you are doing this on a NT 4.0 or Windows 2000 computer, note that the batch file does not execute as a Post-Setup Executable.</li> Note that when you are running the setup routine on a Win 9X computer, the batch file executes successfully.</li></ol>

<div class="references_section">