Audacity cannot find correct path to file.

Using Windows XP sp2 : I have been using various versions of audacity 1.13.xx betas over past couple of years or so and have never had similar problems. I uninstalled the beta before installing version 2 using the windows .exe installer download.

Version 2 generally works fine once opened independently. I got through the association problems listed elsewhere on this forum and I have wav and mp3 associated with audacity and showing in the context menus. But when I click on a file name, audacity opens and an “Error opening file” dialog appears showing :
“could not open file : C:documents”.

Clicking the ok button immediately opens another instance of audacity with another error message :
“could not open file : C:documents and settingsymes documentsaudioworkand”

Clicking ok gets yet another instance of audacity and another incorrect path - this continues for 5 instances of audacity but the file never gets opened and the path is never shown correctly.

The correct path on my machine would be : C:documents and settingsymes documentsaudioworkfilename.wav (or filename.mp3)

If I place the audio file in the root directory of C drive (ie. C:filename.wav), a click on the file name opens audacity with the file loaded correctly. The problem has disappeared.

If I associate the wav and mp3 with any other audio application, the file opens correctly in that app wherever it happens to be in my directory structure. And that was how it always worked with the 1.13.xx beta versions.

It looks like my installation of audacity 2 is unable to construct correctly the path to the file. Any ideas of what I may be able to do to correct this ?

My first suggestion is quick and easy so I suggest trying this first:
The Audacity Preference file is called “audacity.cfg” should be in the equivalent of:
C:Documents and Settings__Application DataAudacity

(“Application Data” is a hidden folder)

Ensure that Audacity is closed.
Find the audacity.cfg file and open it in NotePad.
Delete everything from that file apart from the line:
NewPrefsInitialized=1
Save and close the file.
Restart Audacity 2.0 and you should see the welcome screen.
Close Audacity and then retest opening a file.

I am not expecting this to solve the problem, but it will rule out some possibilities.

Would you feel confident in editing the Windows Registry if I give precise instructions of what to do?
(note that messing up the registry can stop Windows from booting, so it’s essential to be careful when making changes to the registry).

Yes. The Windows registry settings for those file types is messed up.

I think this should fix the problem:

Uninstall Audacity 2.0
Install CCleaner from Speed up, optimize and clean your PC for free | CCleaner for PC
Run the CCleaner Registry cleaner (and make a backup of the registry when prompted to do so).
Reinstall Audacity 2.0
You should now be able to set the file associations.

According to his post, philj34 has already associated WAV and MP3 with Audacity. Audacity opens when you double-click the WAV or MP3, so I am not sure CCleaner will help.

The actual issue is that Audacity treats each word in the path to the file as a separate file. This almost always means that %1 is missing from the end of the registry key, and I don’t understand how that happened unless philj34 edited the registry himself.

Can you (philj) say exactly how you overcame the file associations issue? if you edited HKEY_CLASSES_ROOTApplicationsaudacity.exeshellopencommand then the value needs to be this:

"C:Program FilesAudacityaudacity.exe" "%1"

Gale

I was able to reproduce the problem on Windows XP by trying to set WAV files to open with Audacity 2.0 while there was an existing file association with a previously uninstalled Audacity 1.2.x.

After removing all instances of Audacity from the system, The Registry cleaner in Ccleaner will remove the Audacity keys (because Audacity no longer exists), which then allows “open with” to work correctly when Audacity 2.0 is reinstalled.

Which problem could you reproduce, “looking only for the first word in the path”? Otherwise, I still think this is off-topic to Phil’s problem since he already is able to open 2.0.0 by double-clicking a WAV or MP3.

I thought the upgrading to 2.0 issue with “Open with” only happened when you had already set a file association with 1.3 (because the path to audacity.exe is then different), and not when upgrading from 1.2 to 2.0. I’ll test it on my XP machine later.


Gale

@Gale/@Steve,
Having more than one version of a program, installed into different folders, and having both programs appear in the “Open With…” window of Recommended Programs is not wrong or impossible under Windows (at least, not under Windows 7 on my system). I also have installed on my PC the AV software “Pictures-To-EXE”. I have both v6.5 and v7.0 installed. If I right click a .pte file (the project file for that software - analogous to the .aup for Audacity) and go down the Open With route, I see two identical icons: one for v6.5 and one for v7.0. The program’s executable file name is, in both cases, PicturesToExe.exe: the folder structure under C:Program Files (x86) is different. It can be done. So why cannot Audacity do it?

Yes, that was the question that I was replying to and I reproduced that problem on my virtual XP machine, then fixed it with the steps given.


Yes, that is the Windows bug/limitation that Gale has repeatedly described.

Audacity does not create file associations with audio files and as far as I’m aware it never has done.
Windows requires registry keys to be created to enable file associations. A registry key will be created if the user sets up a file association, but that method of creating the registry key will only produce one entry for a specific program name. Attempting to set up a second file type association to a program with the same name (in a different path) does not create a second registry key. Windows sees that it already has a registry key for that program name and ignores the new information that has been added by the user. It may be possible to edit the registry to provide the second application option, but I don’t use Windows 7 so I’d just be guessing.

Until now there has been very little demand for Audacity to automatically create registry entries. The main difference with 2.0 vs. 1.3.x versions is that Audacity 2.0 does not overwrite the previous 1.3.x version, so people are running into this file association issue because they have two versions installed. There are currently some discussions about whether Audacity can make it easier for users to set up file associations correctly.

Makes no sense to me, Steve. On a real XP machine I removed all Audacity keys from the registry, installed 1.2.6, set “Open with” to associate with WAV, double-clicked a WAV to open it in 1.2.6.

Then quit and uninstalled 1.2.6, installed 2.0.0, double-clicked a WAV deep in the file structure that contained spaces in the file name and it opened in 2.0.0.

Then I repeated all the above but this time not setting WAV to always open with Audacity, just have it available in the “Open with” context menu. Again, worked perfectly.

I can only assume this sort of test does not work properly in a virtual machine?



Gale

Yes, that’s how it should work, and how it does work on my VM unless I try really hard to mess it up.
It wasn’t particularly easy to reproduce the OP’s problem but I’m quite skilled at breaking things :wink:

The underlying problem seems to be that there are different registry keys that get set when associating files with applications depending on how you do it. I think that the problem that the OP had was that there were conflicting registry keys. Cleaning out all of the Audacity related keys (using Ccleaner) and starting again (re-installing Audacity 2.0) fixed the problem.

Were you then setting associations in the registry, or setting associations using “Open with” when it had previously been done some other way?

It’s hard to comment unless you give the steps, but the “usual, known” way to create this problem is miss off the “%1” from the registry value.


Gale

You’re right Gale.

Steps to reproduce:

From an Explorer window:
Tools > Folder Options > File Types > .WAV > Advanced
Select “open” and click “Edit”.
Click “Browse” and select Audacity.
Click “OK”

“Application to Perform this action” is recorded as:
“C:Program FilesAudacity 1.2.5audacity.exe” %1
The registry key in my case was:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOTVLC.wavshellopencommand]
@=""C:\Program Files\Audacity 1.2.5\audacity.exe" %1"

Put double quotes around the “%1” and the problem is fixed.

Sorry - I’ve been away a couple of days and I am surprised and pleased with the amount of suggestions I’ve found.

First, I tried the steps suggested by Steve - deleting contents of the cfg file and getting audacity to rebuild the file. As he predicted, this did not improve matters, or change anything.

Next, it seemed to me that the idea of windows registry still having conflicting entries was interesting and worth a try. Note that when registering wav and mp3 to audacity to get an option for ‘open with…’ or just a click on the file name, I did not interfere with the registry by direct edit but used the association options provided with WinXP. Not that I’m against a direct edit but the windows systems seemed to cope ok.

So — I uninstalled audacity, used CCleaner to clean out the registry (I saw a possibly conflicting association entry for audacity 1.3.x beta). Re - installed audacity 2. Used the windows dialog to associate wav and mp3 with audacity.

Then audacity worked as expected for both ‘open with …’ and for direct click on filename.

So it seems that simply uninstalling previous versions of audacity is not enough on its own. You should use something like CCleaner to purge the registry.

Anyway, thanks for the help – all’s turned out well.

That’s why I never recommend setting defaults that way (use “Open with” instead). “File Types” is useful if you want to create a custom-named context menu (whether or not you make Audacity default application), but then you must remember the “%1”. On my XP system it does not get added at all.

For better or worse, that “File Types” tab has been removed from Vista and 7.


Gale

The %1 does not appear to be added when you first enter it, but if you go back to edit it again you’ll probably find that it has been added (but without the quotes).

Have they replaced it with something else?

There are significant differences between the two methods - I’ll write more about this here: (soft) file associations lost

I forgot to say that after using Ccleaner on the registry and reinstalling Audacity2 and setting the wav associations, I went into he registry to check what XP had entered and found :

HKEY_CLASSES_ROOTApplicationsaudacity.exeshellopencommand was set to “C:Program FilesAudacityaudacity.exe” “%1”

This is complete with all quote marks as in discussion above. So XP can get it right.

How did you set the WAV associations?


Gale

I n windows explorer, I used Tools/folder options/file types

I’ve tried it multiple times using a fully updated Windows XP SP3 and it gets it wrong, so even if it can sometimes get it right it is still buggy (and Microsoft have never bothered to fix it in how many years?)