Virtual folders for batches - execution directory - Printable Version +- Tordex Community (http://forum.tordex.com) +-- Forum: True Launch Bar (http://forum.tordex.com/forum-3.html) +--- Forum: Features Discussion (http://forum.tordex.com/forum-9.html) +--- Thread: Virtual folders for batches - execution directory (/thread-1627.html) |
- Matthias Reissmann - 09-13-2004 Hi, I would like to have a virtual folder on a directory with batch-files. Because the menu-system of TLB is dynamic, every change in that directory results automatically in a change of the menu - very nice! But the work directory of this batches is not (at least) the directory of the batch files. I can make links to this batches and with that it is possible to define a work directory, but this is not the idea. Possibly I'm too blind but I didn't find an option or setting for this. Can somebody help me or is it possible to change the work directory in the next version? Matthias I'm sorry about my bad english! - Dracula - 09-13-2004 You can only assign a 'work directory' to shortcuts, not to the actual files. That's not a limitation of TLB, but it's just how Windows works. If you're not convinced, open your batch-folder in explorer and try to change the work directory of any of the batch files... indeed: impossible The solution is to create a directory that contains shortcuts to your batch-files, maybe one level deeper... And then create a virtual folder pointing to that directory... Or you could add one line to your batch files so they would change to their work directory themselves, but that's not very pretty :p - Matthias Reissmann - 09-13-2004 Ok, but if a program starts another program, that new program runs in the active dir of the calling program. So switching the active dir of the main program to the dir with the batch and then start the batch would help. Or is it wrong? - I don't thinks so because I used that in Borland Pascal before. Matthias - Dracula - 09-13-2004 Aah, my mistake, you already mentioned the shortcuts in your opening post... :0 I think I now see what you mean. I created a batch file "C:\4NT\cwd.bat", which simply displays the work (startup) directory: Code: @echo off If I drag it to TLB in order create a shortcut, and then launch it from there, it says C:\4NT If I create a virtual folder to C:\4NT and then run the batch file from the virtual folder, it says C:\Documents and Settings\username So the work directory is indeed incorrect when launching programs from a virtual folder. But I think this is quite easy to fix, since it's probably just one ShellExecuteEx statement with a missing parameter... - Matthias Reissmann - 09-13-2004 YES that's it!! If you are in the directory with the batch, then you can use relative paths to sub-batches and so on - and THAT would be VERY NICE! If you have to make links, you can only see what you have linked - and nothing more. With that virtual folder you can see ALL - dynamic - but you can't use complexer scripts (like scripts for preparing or erasing DVDs with Nero). So this modification would be a great deal (at least for me). Matthias |