Virtual folders for batches - execution directory
Started by Matthias Reissmann


Rate this topic
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5


5 posts in this topic
Matthias Reissmann
Junior Member
**


0
5 posts 1 threads Joined: Jul 2004
09-13-2004, 12:49 AM -
#1
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
Senior Member
****


0
407 posts 28 threads Joined: Dec 2002
09-13-2004, 03:25 AM -
#2
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 Wink

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
Windows 7, IE 9.0, Shell 6.0.6000.16386, TLB 4.2.3 beta
Matthias Reissmann
Junior Member
**


0
5 posts 1 threads Joined: Jul 2004
09-13-2004, 03:52 AM -
#3
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
Senior Member
****


0
407 posts 28 threads Joined: Dec 2002
09-13-2004, 04:33 AM -
#4
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
cd
pause >nul
If I double click on it in explorer, it says C:\4NT
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...
Windows 7, IE 9.0, Shell 6.0.6000.16386, TLB 4.2.3 beta
Matthias Reissmann
Junior Member
**


0
5 posts 1 threads Joined: Jul 2004
09-13-2004, 04:47 AM -
#5
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


Forum Jump:


Users browsing this thread: 2 Guest(s)