-Cannot delete folder after open configuration files

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

JFierce7
Senior Member
Senior Member
Posts: 214
Joined: 2005-07-17, 10:47 UTC

-Cannot delete folder after open configuration files

Post by *JFierce7 »

After opening configuration files for direct editing, what ever folder had been open in the currently chosen side at that moment of time cannot be deleted until both instances of notepad with configuration files have been closed.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3379
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

ANd this is NOT a TC bug but Windows that locks the folders....
Hoecker sie sind raus!
JFierce7
Senior Member
Senior Member
Posts: 214
Joined: 2005-07-17, 10:47 UTC

Post by *JFierce7 »

Sir_SiLvA wrote:this is NOT a TC bug
Sure it is. TC needs to set a certain working (or current) directory when opening notepad as a process. It could use the folder where wincmd.ini resides or the temp folder.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6975
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

JFierce7 wrote:
Sir_SiLvA wrote:this is NOT a TC bug
Sure it is. TC needs to set a certain working (or current) directory when opening notepad as a process. It could use the folder where wincmd.ini resides or the temp folder.
Sorry but that is not what I normaly want.
TC should not change the current working dir just because I'm starting some program. I may want to work exactly on that current folder within the editor.
The problem you are describing will happen once in a million I guess.
Any you can easy avoid it by changing the dir to whatever you want before you make config changes.
JFierce7
Senior Member
Senior Member
Posts: 214
Joined: 2005-07-17, 10:47 UTC

Post by *JFierce7 »

Horst.Epp wrote:Sorry but that is not what I normaly want.
TC should not change the current working dir just because I'm starting some program. I may want to work exactly on that current folder within the editor.
I'm talking about the "current working directory" of the notepad processes that have opened the configuration files wincmd.ini and wcx_ftp.ini. IMO, one would expect, that its current directory is the directory of the configuration files. I would think its rather unusual to use these editor instances for other files.

Of course, the current directory of TC or any other editor window should not be changed.
User avatar
Dalai
Power Member
Power Member
Posts: 9966
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Not it's not a TC bug, it is working as designed. The current directory is always used as working dir for newly created processes (and it is good this way).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

The same thing happens if you open a file for editing in Notepad from Windows Explorer - in that case you can not delete the directory containing the file, neither from Explorer, nor from TC
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
JFierce7
Senior Member
Senior Member
Posts: 214
Joined: 2005-07-17, 10:47 UTC

Post by *JFierce7 »

Dalai wrote:Not it's not a TC bug, it is working as designed. The current directory is always used as working dir for newly created processes (and it is good this way).
Editing configuration files (initiated via the corresponding menu item) is not the "usual" start of a new process. It's a special function used for exactly that: editing of config. Locking some unrelated folder is a bug.
petermad wrote:The same thing happens if you open a file for editing in Notepad from Windows Explorer - in that case you can not delete the directory containing the file
Of course. But I don't want to delete the directory where wincmd.ini is in. The problem is that any folder that just happens to be open in TC when you start editing wincmd.ini via menu cannot be deleted.
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

The problem is that any folder that just happens to be open in TC when you start editing wincmd.ini via menu cannot be deleted.
It is not TC that locks the folder it is Notepad - just try it with a program like Unlocker ( http://www.emptyloop.com/unlocker/ ) - it will show you that it is Notepad that is locking the directory.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Dalai wrote:Not it's not a TC bug, it is working as designed. The current directory is always used as working dir for newly created processes (and it is good this way).
I can't agree. All API functions (CreateProcess, ShellExecute and ShellExecuteEx) provide a way to set the starting directory for the newly created process.


I can confirm the problem, that JFierce7 reported.

When I go to "c:\test" directory in TC and use Configuration -> Change Settings Files Directly menu, I can see in the Sysinternals Process Explorer:

Code: Select all

Path:
    C:\WINDOWS\system32\notepad.exe
Command line:
    notepad.exe C:\Documents and Settings\X\Application Data\GHISLER\wincmd.ini
Current directory:
    c:\test\
So Notepad blocks "c:\test" directory and this directory can't be deleted in TC.


Current directory should be set to the directory of wincmd.ini:

Code: Select all

Current directory:
    C:\Documents and Settings\X\Application Data\GHISLER\
Same situation is with wcx_ftp.ini.

Regards
User avatar
Dalai
Power Member
Power Member
Posts: 9966
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

MarcinW wrote:
Dalai wrote:Not it's not a TC bug, it is working as designed. The current directory is always used as working dir for newly created processes (and it is good this way).
I can't agree. All API functions (CreateProcess, ShellExecute and ShellExecuteEx) provide a way to set the starting directory for the newly created process.
I meant TC is always using the current folder as working dir. What function TC uses (or doesn't use) doesn't matter in this regard.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
petermad
Power Member
Power Member
Posts: 16032
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

Current directory should be set to the directory of wincmd.ini:
This is not a bug but a request, that you could make a topic for in TC suggestions (English) and it should rather be set to the directory of %COMMANDER_INI% wich might not be wincmd.ini
.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
JFierce7
Senior Member
Senior Member
Posts: 214
Joined: 2005-07-17, 10:47 UTC

Post by *JFierce7 »

petermad wrote:It is not TC that locks the folder it is Notepad - just try it with a program like Unlocker ( http://www.emptyloop.com/unlocker/ ) - it will show you that it is Notepad that is locking the directory.
If TC would have an internal editor for wincmd.ini which would lock what ever directory is currently open and which is in no kind related to any config file, would you say this is another situation?

TC makes use of notepad for some internal function. It should avoid any side-effects (which even may influence third party programs). I would treat any such side-effect as bug.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3379
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

JFierce7 wrote:
petermad wrote:It is not TC that locks the folder it is Notepad - just try it with a program like Unlocker ( http://www.emptyloop.com/unlocker/ ) - it will show you that it is Notepad that is locking the directory.
If TC would have an internal editor for wincmd.ini which would lock what ever directory is currently open and which is in no kind related to any config file, would you say this is another situation?

TC makes use of notepad for some internal function. It should avoid any side-effects (which even may influence third party programs). I would treat any such side-effect as bug.
If you dont like it redirect your complains to www.microsoft.com please as they create your os and its an os
security feature :twisted:
JFierce7
Senior Member
Senior Member
Posts: 214
Joined: 2005-07-17, 10:47 UTC

Post by *JFierce7 »

Sir_SiLvA wrote:If you dont like it redirect your complains to www.microsoft.com please as they create your os and its an os
security feature :twisted:
Sorry - do you feel personally insulted? I see your smiley, but I don't understand your reasoning. Why not keep it technical?

Is it so hard to understand? You say it's a "security feature". That's okay for me. However, the "security feature" is not correctly used. It's simply the wrong directory that is locked because the call to notepad misses some parameter.
Post Reply