PRB: Batch Files Do Not Run as Post Executables in Setup Routine (271405)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 5.0, when used with:
    • the operating system: Microsoft Windows NT
    • the operating system: Microsoft Windows 2000
  • Microsoft Visual FoxPro for Windows 5.0a, when used with:
    • the operating system: Microsoft Windows NT
    • the operating system: Microsoft Windows 2000
  • Microsoft Visual FoxPro for Windows 6.0, when used with:
    • the operating system: Microsoft Windows NT
    • the operating system: Microsoft Windows 2000

This article was previously published under Q271405

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.

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

  1. 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.

  2. 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.
  3. 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.
  4. 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.
  5. Note that when you are running the setup routine on a Win 9X computer, the batch file executes successfully.

REFERENCES

For additional information on the post-setup option in the Visual FoxPro Setup Wizard, click the article numbers below to view the articles in the Microsoft Knowledge Base:

176887 FIX: Running VFP Exe as Post-Setup Executable Hangs the Process

194434 HOWTO: Using the Setup Wizard in Visual FoxPro 6.0


Modification Type:MajorLast Reviewed:5/12/2003
Keywords:kbAppSetup kbBug kbprb kbvfp500aFIX kbwizard KB271405