TC won't delete a Canon RAW file if it was opened recently

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *petermad »

If the RAW Image Extension is installed then "Windows Photo Viewer" (not the same as the "Photos" Metro app) can show .cr3 images.

A button for opening the file under the cursor with Windows Photo Viewer could be this:

Code: Select all

TOTALCMD#BAR#DATA
rundll32.exe shimgvw.dll,ImageView_Fullscreen
%P%N
WCMICONS.DLL,26
Open image in Windows Photo Viewer


-1
To make the button:
1. Mark the text in the box here above (click SELECT ALL).
2. Copy it to the ClipBoard (press Ctrl+C).
3. Right click on TC's buttonbar and choose "Paste".
This button will set Windows' accociation system aside.



BTW, you can open the "Photos" app from command line with this command:

Code: Select all

ms-photos:
it must end with a colon. Unfortunately you cannot pass a file to this command, neither can you to the command:

Code: Select all

%SystemRoot%\explorer.exe shell:appsFolder\Microsoft.Windows.Photos_8wekyb3d8bbwe!App
which will also launch the "Photos" app.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Mr.Scully
Junior Member
Junior Member
Posts: 16
Joined: 2011-11-03, 22:23 UTC

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *Mr.Scully »

I'm not a native English speaker so I misunderstood the difference between command line and command prompt. Yes, FastStone can open the file by passing a parameter. Anyway, in both cases (command line, command prompt) the file is not locked and can be deleted. It's locked only if it's viewed via Total Commander (either by doubleclicking or by right mouse click and opening in a program). It looks like any action via Total Commander launches the dllhost.exe process which seems to be called COM Surrogate in the list of processes (https://www.howtogeek.com/326462/what-is-com-surrogate-dllhost.exe-and-why-is-it-running-on-my-pc/).

And now comes the weird thing. I killed this process, it's not locking the file anymore but I still am not able to delete the file! LockHunter tells me that the ONLY process having access to the file is Total Commander...
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *white »

Mr.Scully wrote: 2022-08-19, 07:17 UTC Yes, FastStone can open the file by passing a parameter. Anyway, in both cases (command line, command prompt) the file is not locked and can be deleted. It's locked only if it's viewed via Total Commander (either by doubleclicking or by right mouse click and opening in a program).
So it's not locked if it's viewed via Total Commander by running the FastStone program and passing the file as parameter, correct?
(This can be done on TC's command line, by creating a button on TC's button bar, or by creating an internal association in TC)

So it's not that it is always locked when viewed via Total Commander, but only when using right-click or double-click. Correct?

I just want to make sure where the problem is and your answers are still inconclusive.
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *Hacker »

Mr.Scully,
What is the file association of the file when you click on the file and select File - Associate With... - Edit type? Can you perhaps make a screenshot and upload it somewhere?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Mr.Scully
Junior Member
Junior Member
Posts: 16
Joined: 2011-11-03, 22:23 UTC

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *Mr.Scully »

white wrote: 2022-08-19, 08:51 UTC So it's not locked if it's viewed via Total Commander by running the FastStone program and passing the file as parameter, correct?
(This can be done on TC's command line, by creating a button on TC's button bar, or by creating an internal association in TC)
My apologies. I'm not familiar with the button bar. But if TC's command line does the same thing then I just tested it and it locks the file and it cannot be deleted. And the only process accessing the file is Total Commander.

So the file is locked and cannot be deleted if:
- I open it in TC by double clicking on the file
- I open it in TC by right mouse click and "open as"
- I run the image viewer on the TC's command line and pass the filename as parameter
(After I killed the suspicious "dllhost.exe" process nothing changed, the file is still locked - this time ONLY by Total Commander).

The file is not locked and can be deleted if:
- I run the image viewer in Windows and open the file using the app
- I run the image viewer via Windows command line ("cmd" run either in Win or via TC) and pass the filename as the parameter
- I doubleclick on it in File Explorer

The fact that it cannot be deleted is less annoying than the fact that TC freezes for five minutes... Normally if a process blocks the file then TC returns an error message and everything is fine. But this time TC is the only process accessing the file and it won't return an error message, it simply freezes at 0%.


Hacker: the internal association of the file leads to the photo viewer (FastStone MaxView).
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *Hacker »

Mr.Scully,
the internal association of the file leads to the photo viewer (FastStone MaxView).
Is e.g. "DDE" checked?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Mr.Scully
Junior Member
Junior Member
Posts: 16
Joined: 2011-11-03, 22:23 UTC

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *Mr.Scully »

No, DDE wasn't checked.
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *white »

Mr.Scully wrote: 2022-08-19, 11:41 UTC Hacker: the internal association of the file leads to the photo viewer (FastStone MaxView).
Note that in TC there is a difference between internal association (TC only) and association (system wide Windows association). You are probably talking about Windows association here, which is fine because that is what Hacker was asking for.

Thanks for making it clear that the locking also happens when you run the image viewer on the TC's command line and pass the filename as parameter. Doesn't get you closer to the solution, but at least that's clear now.

You say it doesn't happen when you run cmd in TC and then run the image viewer with the filename as parameter. Probably it also doesn't happen when you run cmd in TC and then run the image file.

As long as you haven't found a solution yet, you might be able to do an ugly workaround by always using cmd to launch the viewer. For example by creating an internal association (TC only) with the following data:

Code: Select all

File Type: *.CR3 *.CR2

Change icon: C:\Program Files\FastStone MaxView\MaxView.exe

Actions
Open: %comspec% /c ""C:\Program Files\FastStone MaxView\MaxView.exe" "%1""
or:

Code: Select all

File Type: *.CR3 *.CR2

Change icon: C:\Program Files\FastStone MaxView\MaxView.exe

Actions
Open: %comspec% /c ""%1""
(check if the path names are correct and adjust file type to your liking)
User avatar
Mr.Scully
Junior Member
Junior Member
Posts: 16
Joined: 2011-11-03, 22:23 UTC

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *Mr.Scully »

Yes, once again I was confused and I was speaking about the standard association, not about internal TC association, sorry about that. Thanks, the workaround by using the internal association seems to work. Better than nothing for sure :-)

I still wonder what the cause of the original issue might be, considering that the only process blocking the file was Total Commander itself. I'm aware that it's not happening to other people. Must be somehow related to my computer but it was happening to me on Windows 10 as well as on this fresh install of Windows 11 with only a couple of programs installed...
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *white »

Mr.Scully wrote: 2022-08-19, 14:11 UTC Thanks, the workaround by using the internal association seems to work.
You're welcome. Just out of curiosity, both Open commands I listed worked?
Mr.Scully wrote: 2022-08-19, 14:11 UTC Better than nothing for sure :-)
You will see the cmd window pop up shortly. I know a trick to hide that window if you are interested.
Mr.Scully wrote: 2022-08-19, 14:11 UTC I still wonder what the cause of the original issue might be, considering that the only process blocking the file was Total Commander itself. I'm aware that it's not happening to other people. Must be somehow related to my computer but it was happening to me on Windows 10 as well as on this fresh install of Windows 11 with only a couple of programs installed...
Have you tried uninstalling those couple of programs to see if the problem then disappears?

2ghisler(Author)
Do you have an idea what is causing this?
User avatar
Mr.Scully
Junior Member
Junior Member
Posts: 16
Joined: 2011-11-03, 22:23 UTC

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *Mr.Scully »

white wrote: 2022-08-19, 14:35 UTC You're welcome. Just out of curiosity, both Open commands I listed worked?
Actually I don't know if I did it right because I wasn't asked to supply any parameters. I just added a simple internal TC association and that seems to have done the trick. Now I can delete the recently opened files.

https://www.queenconcerts.com/tmp/tcint.jpg

Maybe I did it wrong because I don't see the cmd window at all, not even for miliseconds. But everything works fine now, I tested several files and I can open and delete them immediately. So I consider this to be a solution to my problem even if it's just a workaround or even if you meant it in a slightly different way :) But the internal association has solved it.
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC won't delete a Canon RAW file if it was opened recently

Post by *white »

Mr.Scully wrote: 2022-08-19, 14:57 UTC
white wrote: 2022-08-19, 14:35 UTC You're welcome. Just out of curiosity, both Open commands I listed worked?
Actually I don't know if I did it right because I wasn't asked to supply any parameters. I just added a simple internal TC association and that seems to have done the trick. Now I can delete the recently opened files.

https://www.queenconcerts.com/tmp/tcint.jpg
Seems what I expected was right after all. You now use program with parameter instead of windows association and the problem does not occur. You don't need to use cmd.

The parameter "%1" is added automatically when you use the >> button and select a program. But you can edit the fields freely and changed it to whatever you need. You don't have to use the >> buttons.

You now have 2 separate internal associations for .cr3 and for .cr2. You can combine them into one if you like. And add additional file types if you need that.
Mr.Scully wrote: 2022-08-19, 14:57 UTC So I consider this to be a solution to my problem even if it's just a workaround or even if you meant it in a slightly different way :) But the internal association has solved it.
Well, I meant it this way first, but from your answers I thought it wouldn't work :)
Post Reply