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

Here you can propose new features, make suggestions etc.

Moderators: Stefan2, white, sheep, Hacker

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

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

Post by *Lolly-Bob » 2018-07-03, 11:38 UTC

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: 6314
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai » 2018-07-03, 13:50 UTC

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
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups

Lolly-Bob
Junior Member
Junior Member
Posts: 17
Joined: 2015-09-01, 15:09 UTC

Post by *Lolly-Bob » 2018-07-03, 14:02 UTC

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

Best regards

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

Post by *petermad » 2018-07-03, 20:30 UTC

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
Danish Total Commander Translator
TC 9.21a 32+64bit on Win XP 32bit, Win 7, 8.1 & 10 64bit and TC 2.92b1 on Android 6.0
Get: Extended Total Commander Menus | PHSM-Calendar

Post Reply