For years Flash has allowed any valid Windows executable to be launched via fscommand EXEC from a Flash projector. That has come to an end with Flash CS3. Flash 9 projectors fail to launch BAT files on Windows 2000, XP and Vista but it still works on Windows 98 and ME! This is major inconvenience but it's not the end of the world. First I'll show you why it's broken, then I'll show you how you can still launch BAT files from your Flash projectors, with a little help...

On NT based systems (2000, XP and Vista) Flash 9 projectors now create child process with a UNC path instead of a simple DOS path as all previous versions of the standalone player have done. The resulting error when you launch a BAT file appears for a fraction of a second but I managed to capture it.

Why is Flash trying to launch CMD.EXE when we asked it to start a BAT file? CMD.EXE is the Windows command processor that handles BAT files. When ever you run a BAT file Windows starts a copy of CMD.EXE to handle it. It's CMD.EXE that's responsible for the ugly DOS box you see when running BAT files.

Because CMD.EXE doesn't understand UNC paths it can't set the current directory and so it defaults to the Windows directory. Since your BAT file is not in the Windows directory CMD.EXE can't find it to process it and the call to EXEC fails.

The same fate may befall any application that uses the output of GetModuleFileName, GetCurrentDirectory, or attempts to parse the command line without accounting for the possible use of UNC paths. I created a simple application display it's own command line and the current directory to demonstrate the difference between Flash CS3 and previous versions.

When called from a Flash 8 projector:

When called from a Flash CS3 projector:

This doesn't mean that all applications will automatically fail, but if they depend on the current directory and they don't accept UNC paths, then they may not work as expected.

The reason you can still run BAT files on Windows 98 and ME is because they use a different command processor ( and Flash CS3 doesn't generate UNC path on these systems. So for these older Windows systems you can still EXEC a BAT file.

Unless Adobe reverts to passing DOS paths instead of UNC path there is only one feasible solution to using BAT files with Flash. Instead of launching the BAT file directly we need a helper application that can launch the BAT files for us instead of depending on the command processor. Luckily a FREE solution to this problem already exists.

A few years ago I created a utility called proxy to run BAT files and hide the ugly DOS box that appears. It makes your projectors look more professional and gets around the problem Flash CS3 has with BAT files. The proxy utility now has a permanent home on this blog.

Conquering FSCommand EXEC explains how to use proxy and contains a link to download proxy.exe.