HIDE A BATCH FILE WINDOW AND START A .PIF FILE

When you run a batch file on a Win9x system, the black MS-DOS prompt window is displayed until the file is finished running its course. However, you can make a batch file run from a less noticeable shortcut.

Here's how:

  1. Right-click the desktop shortcut to the batch file and select Properties.
  2. Select the Program tab.
  3. From the Run field, select Minimized. This will make the batch file appear only on the taskbar, instead of in a window, for the time that the file is executed.
  4. Select the Close On Exit check box to ensure the icon on the taskbar is removed when the file finishes.

Setting these options in the Properties dialog box creates a Program Information File (.pif). The .pif files have been around since Windows 3.x, and they still perform the same function--they control the environment of the command they specify to be executed.

After you've followed the steps above, you can start the .pif file by double-clicking its icon on the desktop. You can also start the .pif with the help of the Start.exe command. Simply type the following command in the command line:

Start test.pif

This command will run the Test.pif file, which will also run the command contained within it on the Program tab of the Properties dialog box.