WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

DOS

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Create One PIF File for all DOS Applications

Keywords:  dynamic modification of PIF file  

Question:

Do you know of a way to modify the PROGRAM propery of a PIF file from within a batch script? The problem: We have a common routine used to build bat files and launch DOS applications. The PIF file is also common. If the user is running multiples of these DOS applications, when the DOS window is minimized (we're running WIN95), the title displaying in the icon is the same for all and is confusing for the user. I'd like to be able to copy the common PIF to the client, modify the program property (it looks like this is where the title is derived) to the name of the specific DOS application dynamically within my winbatch.

Answer:

Instead of trying to handle and control HUNDREDS of pif files, use this cute trick.
  1. Create a BAT file called DOALL.BAT The contents are:
    	;<------snip-------->
    	%1 %2 %3 %4 %5 %6 %7 %8 %9
    	pause	    
    	;<--------snip---------->
    
    You can add the PAUSE line at the end just for debugging, then remove it later!!

  2. Create a DOALL.PIF for DOALL.BAT by right-clicking on the batch file in Explorer, and select the Properties.

    Set the PIF with all the settings you like.

    ***NB: WinBatch needs the following two settings:

    1. Close Window on Exit, and

    2. Run as a partial windowed window (rather than full-screen window).

  3. Now for example you want to call your old XYZ.BAT file. It is done like this...
    	RunWait("DOALL.BAT","XYZ.BAT various assorted parameters")
    
    Now the xyz.bat file will inherit the pif settings of DOALL.BAT.

    Or, if you wanted to run a DOS utility using this batch file, it might look something like:

    	RunWait("DOALL.BAT","mylogin.exe parameters")
    

    You can copy the DOALL.BAT and DOALL.PIF up on the server to run with your WinBatch script, so that you don't have to have a million BAT and PIF files around.

    And for a compiled EXE, you can distribute both the DOALL.BAT and DOALL.PIF with your Winbatch EXE.


Question:

Isn't there some way to have a winbatch file not only create a program group, and put a icon in the group, but to also make the icon either a non-dos icon, or some way go in and click on "full screen"?

Answer:

What I do is to make the pif file in the same directory as the exe.

(Do this MANUALLY on your computer). Edit the PIF file to remove all path information. Let it default to the current directory. Test to make sure it is not broken (just double click it)

Then I start a DOS window and find the pif file (say xxx.pif)

Then I rename it to xxx.abc

Now I work on the install program. Add the xxx.abc file to the install, and at the last second rename it to xxx.pif

It should go in the same directory as the target applicaiton. THat way you can have exactly the PIF file you want for it.


Article ID:   W12906
Filename:   The Mother of all PIF Files.txt
File Created: 1999:11:04:10:54:56
Last Updated: 1999:11:04:10:54:56