Command Line/Batch File Issue

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
zgwstores
Junior Member
Junior Member
Posts: 12
Joined: 2012-09-29, 18:45 UTC
Location: USA

Command Line/Batch File Issue

Post by *zgwstores »

In using the COMMAND LINE in TC, I can do the following:

c:\> cd\bat

and the COMMAND LINE changes to

c:\bat>

and the active panel changes from c:\ to c:\bat which is expected.

However, if I create and run a BATCH FILE with these commands, the TC COMMAND LINE prompt does not change, and the active panel also does not change.

If I run the batch file from a DOS window, the prompt/directory changes as expected.

Is there something I need to add to the end of my batch file to have TC recognize the drive/directory changes?
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3381
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

you cant change that way path in a running tc
Hoecker sie sind raus!
User avatar
nsp
Power Member
Power Member
Posts: 1950
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Post by *nsp »

cd when used in the command line it is not the shell cd command it is interpreted as the internal TC cd command. This is also possible to call all aliasses you defines.
From a batch file, to change TC folder you should use totalcmd.exe command line parameters or more complicated windows messaging stuff.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Batch files are executed in separate process so has no influence on TC. If you run batch file from DOS window using using start command, it won't change your path too.

Easiest way to change TC current dir from batch file is to run %COMMANDER_EXE% /O /S /L="Path".


white, you're right about /O, thank you.
Last edited by MVV on 2014-01-23, 11:06 UTC, edited 1 time in total.
User avatar
white
Power Member
Power Member
Posts: 5988
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

MVV wrote:Easiest way to change TC current dir from batch file is to run %COMMANDER_EXE% /S /L="Path".
You forgot to include parameter /O
zgwstores
Junior Member
Junior Member
Posts: 12
Joined: 2012-09-29, 18:45 UTC
Location: USA

TC and command line.

Post by *zgwstores »

Thank you so much power users.

As a decade+ user of Norton Commander, I was used to changing the directories via command line, and then I made a batch file for quick navigation to my most used directories.

For example, my batch was called go.bat and I would go %1 would run the command:

goto %1
:%1
C:
cd\data\me\word

I guess now I would
%COMMANDER_EXE% /O /S /L="c:\data\me\word"

What does %commander_exe% represent? TOTCMD.EXE?

Thank you power users.
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3381
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

why figgle with the cmd for folders?
go to your most used folders once and press ctrl+d and save them there :!:
Hoecker sie sind raus!
User avatar
white
Power Member
Power Member
Posts: 5988
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: TC and command line.

Post by *white »

zgwstores wrote:What does %commander_exe% represent? TOTCMD.EXE?
Yes, including full path.
zgwstores
Junior Member
Junior Member
Posts: 12
Joined: 2012-09-29, 18:45 UTC
Location: USA

CMD LINE FOR FOLDERS

Post by *zgwstores »

"why figgle with the cmd for folders?
go to your most used folders once and press ctrl+d and save them there"


I am a TYPING person, not a mouse person.

Everytime my hand leave the keyboard(or anyone else) to goto a directory I have to:

1. Find the mouse.
2. Fit the mouse to their hand.
3. Move the mouse to wherever it needs to navigate on the screen, in this case FAVORITES.
4. Click the mouse.
5. Scroll the mouse.
6. Click the mouse.
7. Move the mouse to the file I want.
8. Click the mouse.

I can go to the command line, type go data and I am wherever I need to be, CTRL-ALT + 2 characters and ENTER and I have opened the file.

A well designed OPERATING SYSTEM would not require the use of a mouse. The beauty of TC is the INTUITIVE and easy to learn keyboard shortcuts. But, perhaps I am one of the few people who used computers before mouse's(Mice does not seem appropriate here) and know the lack of efficiency the mouse introduced...but I am sure I am getting off topic now.

This is why I love and subscribe to TC. For the most part my fingers never have to leave the security of my keyboard....anyone know of a heated keyboard??? Then they never have to leave the security and warmth of my keyboard!!!

Cheers.
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

zgwstores,
You can use ampersand character before some letter of hotlist item name in order to make shortcut. E.g. with item name Do&cuments it is enough to press Ctrl+D and then C to enter documents dir. It is quite useful feature.

Also you can create your custom commands, e.g. with cd command, and assign shortcuts for them, under Configuration - Misc. page. It is a TC power to be able to assign any shortcut for any internal or custom action.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Ctrl+D + FirstCharOfDir works even without an ampersand.
User avatar
nsp
Power Member
Power Member
Posts: 1950
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: CMD LINE FOR FOLDERS

Post by *nsp »

zgwstores wrote: I am a TYPING person, not a mouse person.
If you are a typing person, you should use some aliases and user command unfortunately no completion is done :(
virtual panel with quickfilter and auto loaded list is also a nice way to manage folder shortcuts with minimal access to the mouse.
I personally use a globing tool that generate lists that i load to virtual panel and use quick filter and [ctrl]->/<-
Post Reply