I'm trying to run a .pif file in dosbox. I tried typing the name of the file followed by the extension(like game.pif), but dosbox says "illegal command".

How can i fix this? Is there any other way i can do this (like command line arguments)?

I did a bit searching and realized that the .pif is a shortcut to an .exe file. But running the .exe file does not work for the game as it works in a compatibility mode. And that's what the .pif does here.

  • 1
    A PIF file, as you already discovered, is a shortcut to a DOS executable or batch file. However, DOS doesn't recognize this shortcut file. What is exactly your problem? What do you mean works in a compatibility mode? – Dennis Johnson Mar 26 '18 at 8:10
  • Windows compatibility mode is a way to run older software. DOSBox is another, so setting a compatibility mode is irrelevant for DOSBox. Could you provide more information? What is the result if you run the .exe in DOSBox? What are the contents of the .pif? – Melebius Mar 26 '18 at 8:42
  • Let me explain. The game works properly only when double clicking the .pif file. If i open the original exe file then game shows insert the cd to run the game. I don't know much about this but like i said the game has to be run by opening the pif file. – me_alok Mar 26 '18 at 8:51
  • Ive tested it on windows 95 before and so i'm sure of it – me_alok Mar 26 '18 at 8:51
  • Why the downvote? I thought i was pretty clear with this. – me_alok Mar 26 '18 at 8:52

As it has been explained to you above, a PIF (Program Information File) was used in the days when Windows ran over DOS. It was set of instructions to Windows on how to open a DOS file in a window. Those days are gone now that Windows is its own operating system. You may still be able to read the PIF file to determine what it does then create a BAT file within DOSBox that does the same.

There are also a number of DOS Menu/Launcher apps that you can find in the public domain that should help you.

  • Actually i solved the problem by reading the pif file. An additional -C argument was made in the pif file when running the original exe file. Thanks anyway. – me_alok Apr 11 '18 at 5:25
  • Please try to explain how to read the pif file in your answer as it might be helpful for someone else. I used a hex editor and guess :) – me_alok Apr 11 '18 at 5:26

I'm answering my own question as it might be helpful for someone else who seeks the answer.

Here's what i did to solve the issue. I used a hex editor and like Ælfstangard mentioned, tried to determine what the .pif file actually did. It turns out that the pif file just executes the main application exe file with an extra -C argument which i realized only by reading the .pif file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.