Create a zero-byte file

By | 2011-12-31

During the installation of Visual Studio 6 on Windows 7, 8 or 10, it is necessary to create a zero-byte file called MSJAVA.DLL in the Windows directory. The mere presence of a file with this name will allow installation to proceed. Without it, installation dies.

I’ve been getting quite a few questions from folks lately, asking “Just exactly how do I create a zero-byte file?” There are several ways to do it. Read on to find out how to do it at the command prompt.

But first, why do we need to create this file? One of the requirements of Visual Studio 6 is the installation of a “recent” version of Java, particularly of the Microsoft variety. The installation program for Visual Studio is kludged, so it simply checks for the existence of a file with the name MSJava.DLL in the C:\Windows directory. If this file does not exist, the setup program will force you to install it.

Further, it forces a reboot of the operating system in order for the changes to take effect. Now, we don’t want some moldy old Java from over a decade ago cluttering up our shiny Windows 7 machine, so to bypass this funky requirement, we will create a zero-byte file with the proper name and in the proper location by following these steps:

Method 1

  1. Open an elevated command prompt (run as administrator).
  2. Type the following lines in the command prompt:CD\Windows
    COPY CON MSJAVA.DLL
  3. After hitting enter, you’ll just a blinking cursor. Just press F6 and enter, and your zero-byte file will be created.

Method 2

This one is a little bit more arcane, using FSUTIL. Be careful with FSUTIL, because you can really mess things up with it. Here’s how to create a zero byte file:fsutil file createnew c:\windows\msjava.dll 0

Note that you have to run an Administrator command prompt, since it is writing directly to the Windows directory.

Summary

There, mission accomplished. You can now run setup for Visual Studio 6, and you won’t be forced to install stale Java.

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.