Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am on windows server 2003, but I guess it is the same on windows xp.

I moved some movable applications (usually people create them for usb sticks) to locations like c:\bin\app1\app1.exe. The old location was c:\programs\app1\app1.exe

app1.exe can open files of type *.ap1

When I rightclick file.ap1 and choose open with ... the Open with dialog appears. But it is not working how I expect in this situation. I can choose c:\bin\app1\app1.exe with the "Browse" button, but:

  • app1.exe will not appear in the dialog where I just choosed it in the programs list, like I am used to it after clicking OK on it in the browse dialog.

  • app1.exe will not open it when I click ok in the "Open with" dialog, the application that was assigned until then will still open it

What could be the reason?

  • my account is member of the administrators group
  • I just changed the permissions of the folder c:\bin\app1\ and made sure that the group "Administrators" has all rights. I also inherited this manually to all subfodlers and subfiles.
  • I also tried to move the application (with the whole folder) to "c:\program files\app1\app1.exe
share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

This is only a workaround, so if anyone finds a better answer, I will gladly accept it.

I removed all old references to app1.exe by searching the registry for "app1".

The registry references app1 by different names like "Application One", I searched and removed all of them.

I restarted windows (don't know if this is necessary)

After the restart I could do what I wanted to do (with app1.exe)

Still feels like a dirty hack.

share|improve this answer
    
this is more like uninstall and reinstall in different location :) –  Remus Rigo May 16 '10 at 20:26
add comment

The windows registry keeps track of file types and the applications used to handle them. The overall concept is "file association".

The file type *.txt will be "associated" with one or more applications that can handle this file type. For each file type there is a range of actions that can be performed on the file, known as "verbs". For example: open, print, edit.

For a practical example locate the following registry keys and check the content:

Go to HKEY_CLASSES_ROOT\.txt and check the value of "(Standard)" or "". In my case it says txtfile. Now go to HKEY_CLASSES_ROOT\txtfile and see what content is here. Notice under HKEY_CLASSES_ROOT\txtfile\shell there are a bunch of "verbs" or actions defined, one of which is the "open" key. The sub key "command" will specify a command line to run when any *.txt file is double clicked in explorer. In my case this is:

"%SystemRoot%\System32\NOTEPAD.EXE %1"

The %1 in this command line will expand to the full path of the file you double clicked. Hence double clicking a *.txt file will run Notepad.exe with the full path to the double clicked file as command line.

By locating the corresponding registry sections relating to *.ap1 you should be able to change the command line to point to the right path for the executable.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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