After Ctrl-B + enter set current directory for executed file

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Lolly-Bob
Junior Member
Junior Member
Posts: 54
Joined: 2015-09-01, 15:09 UTC

After Ctrl-B + enter set current directory for executed file

Post by *Lolly-Bob »

Hi,

if I have many sub directories and want to find quickly a certain executable file I use Ctrl+B and then type in the file name or scroll to files with the wanted extension. If I click on that executable file it could happen that the program cannot be started, because it loads a dll from a parallel directory, but the current directory is not the directory of the executed file, so the dll cannot be found. I know it is a bad sample, but if I have a cmd or bat file and it starts on double click from a wrong directory I could destroy files. Many years ago I can remember I had a bat file with a deltree command and disabled inquiry. With Ctrl-B and enter I deleted the half of my hard disk.

So I think it woud be a good idea to set the current directory in Ctrl+B view to the directory of the executed file and it is saver. Perhaps you can support a switch to disable this setting.

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

Post by *Dalai »

Good suggestion. I wasn't aware that TC doesn't set the current directory to the one the launched executable is in (and I can confirm that behavior).

However, there's a workaround. Until this is implemented you can do the following: Press Ctrl+B to activate branch view, look for your executable and set the cursor on it, press Ctrl+B again and then press ENTER. I.e. one step more after setting the cursor and before starting the executable.

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
Lolly-Bob
Junior Member
Junior Member
Posts: 54
Joined: 2015-09-01, 15:09 UTC

Post by *Lolly-Bob »

Thank you. I didn't know that yet. Very helpful.

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

Post by *petermad »

I wasn't aware that TC doesn't set the current directory to the one the launched executable is in
I wasn't either - and I think the current behaviour is dangerous - as Lolly-Bob also points out - this should definitely be changed!
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
Post Reply