Tcmadmin.exe keeps folder open

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Tcmadmin.exe keeps folder open

Post by *MarcinW »

Tested with Windows XP:

Test 1: Try accessing "C:\Test" folder of another user. After asking for user name and password, TC launches tcmadmin.exe. After this, you are not able to delete "C:\Test" folder.

Test 2: Try accessing "C:\Test\File.txt" file of another user. After asking for user name and password, TC launches tcmadmin.exe. After this, you are not able to delete "C:\Test" folder.


TC keeps tcmadmin.exe running even after accessing the password-protected resource. This is probably by design and should stay as it is now. But tcmadmin.exe probably gets "C:\Test" folder as its current working directory.

Solution: always set tcmadmin's working directory to the directory containing tcmadmin.exe (for example "C:\Program Files\Total Commander").

Regards
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48108
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I don't think that it keeps the directory open, I just guess that it's the current directory in tcmadmin.
Author of Total Commander
https://www.ghisler.com
User avatar
MarcinW
Power Member
Power Member
Posts: 852
Joined: 2012-01-23, 15:58 UTC
Location: Poland

Post by *MarcinW »

Well, from the operating system's view its exactly the same :) When the application sets its current working directory, operating system opens a handle to this directory.

In any case, setting the current working directory of tcmadmin.exe to its own directory will probably solve the problem.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48108
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, that should work, I will try it.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48108
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I have changed this now in TC 8.52 beta 1, please try it!
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I can't reproduce it with 8.51a too, TCMADMIN has current directory c:\.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48108
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Anyone else?
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48108
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Note that this only affects Windows XP! On newer versions, tcmadmin.exe is launched via elevation (run as admin) and not "Run as different user". Run as admin always starts with the system32 directory as the current directory.
Author of Total Commander
https://www.ghisler.com
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Ah, that's only for Windows XP, it makes sense. There is a note in HISTORY.TXT regarding OS after Windows XP too so I've checked in my Windows 7 only.

Test in a VM with Windows XP SP3:

TC 8.51a on start TCMADMIN in C:\WINDOWS\Temp\90\: TCMADMIN is started in C:\WINDOWS\Temp\90\.
TC 8.52b1 on start TCMADMIN in C:\WINDOWS\Temp\90\: TCMADMIN is started in C:\TOTALCMD.

Fix is confirmed.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48108
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Great, thanks for checking!
Author of Total Commander
https://www.ghisler.com
Post Reply