Helping people with computers... one answer at a time.

Anytime I try to start up QBasic 4.5 on Windows XP, I get an error stating "Invalid startup directory, please check your pif file. Choose 'Close' to terminate the application." I know that this is a 16bit MS-DOS Subsystem, but this is the only program I am having trouble with. I recently upgraded to WinXP Pro, and needless to say, I was quite surprised when I couldn't write my programs anymore.

Boy... now there's a blast from the past. QBasic has a long history dating back to the days of MS-DOS. QBasic was the free Basic programming language interpreter that was included with MS-DOS, and eventually Windows, though it appears to have vanished from Windows XP, if not from earlier versions.

I feel a personal connection to QBasic. Why? I worked on it!

First, your question: ".PIF" files were the way that older versions of Windows kept track of the settings for some applications. Each application, say QBasic.exe, would have a corresponding PIF file, such as QBasic.pif.

"QBasic was the free Basic programming language interpreter that was included with MS-DOS"

In Windows XP, I believe it's safe to simply remove the QBasic.pif file. Try renaming it first, and seeing if that resolves your problem. You can also try right-clicking on the PIF file in Windows Explorer, selecting Properties, and changing the startup directory, that your error message is complaining about.

I dug up an old copy of QBasic and fired it up, without a .PIF file, on my Windows XP system:

QBasic

Like I said it brings back memories. While at Microsoft I worked on the on-line help technology used in QBasic's predecessor, QuickBasic, several other products, and in QBasic. Need proof? In a command shell, Type the on-line help file qbasic.hlp. The first two bytes are the "signature" that define what kind of a file this is. The signature for character mode help files? My initials: LN.

Article C2480 - December 5, 2005

Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

Recent Comments
18 Comments

My problem is a moody Turbo C++ program. I got the same error message. So I cleaned out all of the guilty pif files. What do I do now? How do I start it up?

Posted by: Carol at September 3, 2010 2:11 AM

I found the pif file - QB [Surprisingly it did not have the extension '.pif' in the name, although I do not hide extensions]. In Properties > Program I set the 'Cmd line' to the correct path to the file, and 'Working' to the correct path to the folder. That solved the problem.
I also ticked 'close on exit' here, & 'window' under Screen. Under 'Memory' I set 'EMS' to 'none', 'XMS' to 'auto' and ticked 'use HMA'. That made it work better I think.

Posted by: Sunil at September 5, 2010 2:28 AM

Thanks for your help! I no longer get the error, but now the game won't run. It seems to run for a fraction of a second, and then disappears. Anyone know what I'm talking about?

Posted by: Gloria at January 1, 2011 11:50 AM

hi sir i wank your kind info from one question??????

i was opened TURBO C++ wizard . its warmed as unrecoverable error , why this error found plz reply me

Posted by: tamil at July 23, 2011 8:10 AM

Thanks; renaming qb.pif by dropping the .pif extension, worked.

Posted by: fred smith at December 13, 2011 11:24 PM
Post a comment on "What's "Invalid startup directory, please check your pif file"?":





Remember Me?

(You may use HTML tags for style)

Before commenting, please...

  • READ THE ARTICLE. A comment that shows you didn't will be deleted and ignored.

  • Comment only on the article. Use the search box at the top of the page if you have a question about something else.

  • NO PERSONAL INFORMATION in the comment. No email addresses. No phone numbers. No physical addresses.

  • Anything that looks the least bit like spam will be deleted. Links to unrelated sites or links that appear to be primarily promotional will be deleted, or the comment will be deleted.

  • Don't ask me to recover lost passwords or hacked accounts. I can't. Those comments will be deleted.

  • I can't respond to every comment. And I can't vouch for the accuracy of others who do.

Please wait. Your comment is being processed ...