Incorrect file associations

Dec 4, 2008
2
0
If I type " foo.jpg", the image is opened in the wrong program.

CMD uses the correct program.

This has been the case for several versions of 4NT/TCMD, up to the latest I have installed (10.0 build 76).

Is there any way to trick it into behaving correctly?
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
I can't explain why CMD behaves differently than TCC. If you type that
same filename from Explorer's Start | Run dialog which program do you get?


>From a TCC prompt the FTYPE and ASSOC commands will show you what the file
type and file associations are.
For example on my PC:

[C:\Program Files\ARM] assoc .jpg
.jpg=Google.PhotoViewer.3.0

[C:\Program Files\ARM] ftype Google.PhotoViewer.3.0
Google.PhotoViewer.3.0="C:\Program
Files\Google\Picasa3\PicasaPhotoViewer.exe" "%1"

-Scott

Thanny <> wrote on 09/17/2009 06:05:03 PM:


> If I type " foo.jpg", the image is opened in the wrong program.
>
> CMD uses the correct program.
>
> This has been the case for several versions of 4NT/TCMD, up to the
> latest I have installed (10.0 build 76).
>
> Is there any way to trick it into behaving correctly?
>
>
>
>
 
May 20, 2008
11,424
99
Syracuse, NY, USA
On Thu, 17 Sep 2009 17:05:26 -0500, Thanny <> wrote:

|If I type " foo.jpg", the image is opened in the wrong program.
|
|CMD uses the correct program.

Do you have a ".JPG" environment variable?
--
- Vince
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,469
88
Albuquerque, NM
prospero.unm.edu
Also, what does ASSOC .JPG report?

If you feed ASSOC's output into FTYPE, what do you get? For example, if ASSOC .JPG reports .JPG=JPEGFILE, what does FTYPE JPEGFILE have to say?
 
Dec 4, 2008
2
0
Also, what does ASSOC .JPG report?

If you feed ASSOC's output into FTYPE, what do you get? For example, if ASSOC .JPG reports .JPG=JPEGFILE, what does FTYPE JPEGFILE have to say?
ASSOC .jpg says "jpegfile", and FTYPE jpegfile shows the path to MS Photo Editor.

But that's not right. I set the association to a program called PMView (old but efficient program that I originally used under OS/2).

In the registry, the key ".jpg" under HKEY_CLASSES_ROOT has a default value of "jpegfile". The key "jpegfile" has shell->Open pointing to MS Photo Editor. This must be what TCMD is looking at, but that's not the key set by Vista's file association applet, and not what Explorer and CMD look at.

The correct key to look at in Vista appears to be HKEY_CURRENT_USER\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ FileExts (spaces added to help with line breaks). For the JPEG example, the subkey under that is .jpg\UserChoice, and the relevant value is Progid, which I've verified points to the program I selected (or, rather, the registry key - PMView.JPG - under HKEY_CLASSES_ROOT that defines how to launch it).

I worked around the issue by changing the default value of the .jpg key to PMView.JPG, and now TCMD launches the right program. But since that's not how Vista itself handles associations, it should be "fixed" in TCMD, even though it looks as though its behavior makes more sense (why would Vista store system-wide settings under a key for Explorer?).
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,469
88
Albuquerque, NM
prospero.unm.edu
ASSOC .jpg says "jpegfile", and FTYPE jpegfile shows the path to MS Photo Editor.

But that's not right. I set the association to a program called PMView (old but efficient program that I originally used under OS/2).

In the registry, the key ".jpg" under HKEY_CLASSES_ROOT has a default value of "jpegfile". The key "jpegfile" has shell->Open pointing to MS Photo Editor. This must be what TCMD is looking at, but that's not the key set by Vista's file association applet, and not what Explorer and CMD look at.

The correct key to look at in Vista appears to be HKEY_CURRENT_USER\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ FileExts (spaces added to help with line breaks). For the JPEG example, the subkey under that is .jpg\UserChoice, and the relevant value is Progid, which I've verified points to the program I selected (or, rather, the registry key - PMView.JPG - under HKEY_CLASSES_ROOT that defines how to launch it).

I worked around the issue by changing the default value of the .jpg key to PMView.JPG, and now TCMD launches the right program. But since that's not how Vista itself handles associations, it should be "fixed" in TCMD, even though it looks as though its behavior makes more sense (why would Vista store system-wide settings under a key for Explorer?).

I don't think it's a Vista thing. If I'm not mistaken, XP works the same way. Systemwide associations go under HKEY_CLASSES_ROOT; per-user associations go under HKEY_CURRENT_USER. Explorer checks the per-user settings first, then falls back on the systemwide. Take Command checks the systemwide association only, AFAIK.

You can bypass the whole messy, two-levels-of-indirection registry business and set your own association for Take Command (only!) by setting an environment variable:

Code:
set .jpg=c:\path\to\pmview.exe

Stick it in TCSTART.BTM, and it'll be set for each new TCC session.
 
May 20, 2008
11,424
99
Syracuse, NY, USA
On Wed, 23 Sep 2009 17:19:38 -0500, Thanny <> wrote:

|In the registry, the key ".jpg" under HKEY_CLASSES_ROOT has a default value of "jpegfile". The key "jpegfile" has shell->Open pointing to MS Photo Editor. This must be what TCMD is looking at, but that's not the key set by Vista's file association applet, and not what Explorer and CMD look at.
|
|The correct key to look at in Vista appears to be HKEY_CURRENT_USER\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ FileExts (spaces added to help with line breaks). For the JPEG example, the subkey under that is .jpg\UserChoice, and the relevant value is Progid, which I've verified points to the program I selected (or, rather, the registry key - PMView.JPG - under HKEY_CLASSES_ROOT that defines how to launch it).
|
|I worked around the issue by changing the default value of the .jpg key to PMView.JPG, and now TCMD launches the right program. But since that's not how Vista itself handles associations, it should be "fixed" in TCMD, even though it looks as though its behavior makes more sense (why would Vista store system-wide settings under a key for Explorer?).

It seems to be the other way around. HKEY_CLASSES_ROOT has the system-wide
settings. The entries in HKEY_CURRENT_USER are user-customizations.

Actually, Microsoft seems to consider this somewhat of a problem. See:

http://support.microsoft.com/kb/950505
--
- Vince
 

rconn

Administrator
Staff member
May 14, 2008
12,365
150
On Wed, 23 Sep 2009 17:19:38 -0500, Thanny <> wrote:

|In the registry, the key ".jpg" under HKEY_CLASSES_ROOT has a default value of "jpegfile". The key "jpegfile" has shell->Open pointing to MS Photo Editor. This must be what TCMD is looking at, but that's not the key set by Vista's file association applet, and not what Explorer and CMD look at.
|
|The correct key to look at in Vista appears to be HKEY_CURRENT_USER\ Software\ Microsoft\ Windows\ CurrentVersion\ Explorer\ FileExts (spaces added to help with line breaks). For the JPEG example, the subkey under that is .jpg\UserChoice, and the relevant value is Progid, which I've verified points to the program I selected (or, rather, the registry key - PMView.JPG - under HKEY_CLASSES_ROOT that defines how to launch it).
|
|I worked around the issue by changing the default value of the .jpg key to PMView.JPG, and now TCMD launches the right program. But since that's not how Vista itself handles associations, it should be "fixed" in TCMD, even though it looks as though its behavior makes more sense (why would Vista store system-wide settings under a key for Explorer?).

It seems to be the other way around. HKEY_CLASSES_ROOT has the system-wide
settings. The entries in HKEY_CURRENT_USER are user-customizations.

Actually, Microsoft seems to consider this somewhat of a problem. See:

http://support.microsoft.com/kb/950505
--
- Vince

It's twice as awful as you think -- in addition to putting the extensions in (at least) two different places, Microsoft also puts the program to execute in at least two different places (shell\open\command and shell\open2\command). The order these are searched and executed also varies depending on the version of Windows.
 
Similar threads
Thread starter Title Forum Replies Date
Charles Dye REGDIR /T : incorrect localization of time stamps Support 4
S incorrect message at start Cancel batch job 4START.bat ? (Y/N/A) : Support 1
rps Fixed @filesize[...,a] space allocated values incorrect Support 2
M TCC incorrect dir output since Windows 1803 Support 6
Fross @Words Incorrect? Support 19
Steve Pitts WAD @MD5 returns incorrect results for strings Support 2
Phil Kane WAD v 17 Displays Incorrect OS Support 6
rps Documentation "Select" command switch order incorrect Support 4
R Fixed Bytes Allocated Total Incorrect in V17 b52 Support 1
M Incorrect ARGV1 when using linux-style paths Support 4
D Minor problem. Incorrect value internal var _dir_files Support 7
S WAD Incorrect _do_loop values Support 18
The Wizard WAD Possible Incorrect COMSPEC handling Support 2
Dan Glynhampton Documentation v15 help: Incorrect Links Support 0
JohnQSmith WAD Incorrect results from @FILESIZE Support 9
T @ping: response code, data size and documentation incorrect Support 2
N Incorrect display under TCMD 13 Support 1
dcantor @AGEDATE example incorrect in help Support 0
C TC10 LIST - print with line nbrs incorrect Support 0
D D:\Settings\Application contains an incorrect path? Support 0
J History file load hangs if file has complete garbage in it... Support 1
jdanielp Cannot step into and/or call another .bat file when debugging .bat file Support 2
thorntonpg file explorer - short cut keys Support 1
JohnQSmith New online help file wrong logo Support 7
Jay Sage WAD Possible Bug With OPTION Command With @FILE Support 5
samintz How to? swap endianness in a binary file Support 12
vefatica `Back quotes` - command line vs. batch file Support 5
fpefpe How to? batch file size Support 2
Jay Sage Issues With TCMD File Explorer Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
Joe Caverly @FILESIZE and NTFS File Stream Support 1
Joe Caverly Embedding an .EXE (or other file) into a .BTM Support 8
U Command help on file names Support 5
S Concatenate all playlists into 1 file Support 22
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
Joe Caverly Rename file that begins with Emoji Support 7
Joe Caverly PSHELL and NTFS File Streams Support 2
P Kill all other instances of tcc from a btm batch file Support 2
D ffind hangs on large file Support 18
Alpengreis Documentation Minor issue in help file for view /E Support 1
fpefpe batch file ending early Support 18
J Licesne file location Support 1
K robocopy cancelling batch file processing Support 28
Jay Sage TCMD Crashes with "tctoolbar /c /r file" Support 5
A Unable to pass batch file arguments unaltered Support 18
MikeBaas How to...extract a string from a .json-file? Support 10
vefatica LIBRARY and file name completion? Support 4
D What does the file "..\Everything\Run history.csv" store? Support 5
H Takecommand.pdf failed not a pdf file Support 6
Joe Caverly DIRectory Colorization in v25 Help File Support 0

Similar threads