New internal commando cm_OpenMyDocuments

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Bernt Ahlbäck
New Member
New Member
Posts: 1
Joined: 2009-06-02, 07:01 UTC

New internal commando cm_OpenMyDocuments

Post by *Bernt Ahlbäck »

The location of My Documents is not fixed so it would be nice to have this commando in "Navigation" section.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Is it so difficult to add My Documents folder to directory hotlist once? Or you want to use this in portable mode?
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

cd %$PERSONAL%
theosdikaios
Senior Member
Senior Member
Posts: 228
Joined: 2006-02-04, 13:02 UTC

Post by *theosdikaios »

In the case of need the real virtual folder then you could use

Code: Select all

cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103}
"Since there are many things which have never happened and never will happen,
and which nevertheless are clearly conceivable, and imply no contradiction,
how can one say they are absolutely impossible?" Leibniz
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

m^2 wrote:cd %$PERSONAL%
Exactly!
New in Total Commander 6.50:

- New pseudo environment variables supported in path names, pointing to locations of virtual folders:
%$APPDATA%, %$DESKTOP%, %$PERSONAL% (My Documents), %$PROGRAMS%, %$STARTMENU%, %$FONTS%, %$STARTUP% (use lowercase to access env vars with these names)
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

'cd %$PERSONAL%' and 'cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103}' are not equivalent.

EXAMPLE on a multilingual Windows XP SP3 where the language of the current user is German:

Code: Select all

cd %$PERSONAL%                              --> c:\Documents and Settings\Wolfgang\My Documents\
cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103} --> \\Eigene Dateien\
After all in this case the contents of both directories are identical.

I suggest to introduce cm_OpenMyDocuments with the behavior of cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103}. Maybe this was already the intention of Bernt Ahlbäck.
Personally I prefer cd %$PERSONAL%, but for some users cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103} is probably the better choice.


Also 'cd %$DESKTOP%' and 'cm_OpenDesktop' are not equivalent.
EXAMPLE on a multilingual Windows XP SP3 where the language of the current user is German:

Code: Select all

cd %$DESKTOP%  --> c:\Documents and Settings\Wolfgang\Desktop\
cm_OpenDesktop --> \\Desktop\
In this case even the contents of the displayed directories are different!
\\Desktop\ shows the merged contents of "c:\Documents and Settings\Wolfgang\Desktop" and "c:\Dokumente und Einstellungen\All Users\Desktop".
MVV wrote:
New in Total Commander 6.50:

- New pseudo environment variables supported in path names, pointing to locations of virtual folders:
%$APPDATA%, %$DESKTOP%, %$PERSONAL% (My Documents), %$PROGRAMS%, %$STARTMENU%, %$FONTS%, %$STARTUP% (use lowercase to access env vars with these names)
The pseudo environment variables seem to work only with the CD command of Total Commander.
I expected that Total Commander would expand them for any user-defined button or menu entry.
What does "use lowercase to access env vars with these names" actually mean?

Generally the pseudo environment variables (and the differences to the corresponding commands) are hardly documented in the online help.
User avatar
m^2
Power Member
Power Member
Posts: 1413
Joined: 2006-07-12, 10:02 UTC
Location: Poland
Contact:

Post by *m^2 »

jb wrote:'cd %$PERSONAL%' and 'cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103}' are not equivalent.

EXAMPLE on a multilingual Windows XP SP3 where the language of the current user is German:

Code: Select all

cd %$PERSONAL%                              --> c:\Documents and Settings\Wolfgang\My Documents\
cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103} --> \\Eigene Dateien\
After all in this case the contents of both directories are identical.

I suggest to introduce cm_OpenMyDocuments with the behavior of cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103}. Maybe this was already the intention of Bernt Ahlbäck.
Personally I prefer cd %$PERSONAL%, but for some users cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103} is probably the better choice.


Also 'cd %$DESKTOP%' and 'cm_OpenDesktop' are not equivalent.
EXAMPLE on a multilingual Windows XP SP3 where the language of the current user is German:

Code: Select all

cd %$DESKTOP%  --> c:\Documents and Settings\Wolfgang\Desktop\
cm_OpenDesktop --> \\Desktop\
In this case even the contents of the displayed directories are different!
\\Desktop\ shows the merged contents of "c:\Documents and Settings\Wolfgang\Desktop" and "c:\Dokumente und Einstellungen\All Users\Desktop".
MVV wrote:
New in Total Commander 6.50:

- New pseudo environment variables supported in path names, pointing to locations of virtual folders:
%$APPDATA%, %$DESKTOP%, %$PERSONAL% (My Documents), %$PROGRAMS%, %$STARTMENU%, %$FONTS%, %$STARTUP% (use lowercase to access env vars with these names)
The pseudo environment variables seem to work only with the CD command of Total Commander.
I expected that Total Commander would expand them for any user-defined button or menu entry.
What does "use lowercase to access env vars with these names" actually mean?

Generally the pseudo environment variables (and the differences to the corresponding commands) are hardly documented in the online help.
Yes, it was said already that they are different.
I see no reason to introduce a new command when cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103} works. Sure it's not instant to find, but works well.
"use lowercase to access env vars with these names": If you creates an environment variable %$PERSONAL% as C:\, cd %$PERSONAL% goes to c:\Documents and Settings\Wolfgang\My Documents\ and cd %$personal% to C:\
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

::{450D8FBA-AD25-11D0-98A8-0800361B1103} doesn't work at my machine (XP SP2, Vista, both RU).

Virtual folders are good but very uncomfortable to use within TC since many features doesn't working there. So cd %$PERSONAL% is a good equivalent to cm_OpenMyDocuments.
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

m^2 wrote:Yes, it was said already that they are different.
In this thread is was not already said explicitly.
m^2 wrote:I see no reason to introduce a new command when cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103} works. Sure it's not instant to find, but works well.
MVV wrote:::{450D8FBA-AD25-11D0-98A8-0800361B1103} doesn't work at my machine (XP SP2, Vista, both RU).
For me the following reasons are enough to introduce cm_OpenMyDocuments:
  1. cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103} seems implementation-specific.
    Obviously already now it does not work on every Windows and it may change with every version of Windows (whenever Microsoft pleases to do so).
  2. cd ::{450D8FBA-AD25-11D0-98A8-0800361B1103} is not instant to find (to put it mildly), much longer, not self-explaining and awkward to enter (even when you take copy&paste for granted).
  3. cm_OpenMyDocuments would be in line with cm_OpenDesktop.
m^2 wrote:"use lowercase to access env vars with these names": If you creates an environment variable %$PERSONAL% as C:\, cd %$PERSONAL% goes to c:\Documents and Settings\Wolfgang\My Documents\ and cd %$personal% to C:\
OK. Thank you.
But regarding pseudo environment variables my main point was that TC seems to expand the pseudo env vars only with the CD command. I find such a limited solution not appropriate for Total Commander.

MVV wrote:... So cd %$PERSONAL% is a good equivalent to cm_OpenMyDocuments.
It's an approximation, not an equivalent as demonstrated in my previous post.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

jb wrote:But regarding pseudo environment variables my main point was that TC seems to expand the pseudo env vars only with the CD command. I find such a limited solution not appropriate for Total Commander.
Really? We can change dir to %$PERSONAL%, we can launch application through %$PERSONAL%. We can do with %$PERSONAL% more than with cm_OpenMyDocuments. :)
jb wrote:
MVV wrote:... So cd %$PERSONAL% is a good equivalent to cm_OpenMyDocuments.
It's an approximation, not an equivalent as demonstrated in my previous post.
Virtual folders made for cases when no usual folder available. In case of Documents folder we have an ordinary folder and a way to go to. Why we should add any commands if we can go to it already with cd %$PERSONAL%? What do you want to see in folder you got after cm_OpenMyDocuments besides contents of %$PERSONAL% folder?
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

MVV wrote:... we can launch application through %$PERSONAL%.
This seems NOT work on my machine. Therefore I wrote already twice that TC seems to expand the pseudo environment variables only with the CD command.
Have you really tried it on your machine?
Can you really pass for example %$PERSONAL%\Test.txt to a compare tool on your machine?
MVV wrote:We can do with %$PERSONAL% more than with cm_OpenMyDocuments.
I never suggested to remove the pseudo environment variables.
Instead I suggested:
  1. Add cm_OpenMyDocuments (as a complement to cd %$PERSONAL%).
  2. TC should expand the pseudo environment variables in all situations (for launching an application, passing parameters, ...), not only with the CD command.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

I can launch:
%$PERSONAL%\MessageBox.exe (test app, message box shows)
%$PERSONAL%\Santa.swf (system asks an application 'cos .swf not registered)
"%$PERSONAL%\WinWars 2002.txt" (Notepad launches, long name, so works only with quotes)
%TEMP%\Spider\Spider.exe (app launches)
jb wrote:[*]TC should expand the pseudo environment variables in all situations (for launching an application, passing parameters, ...), not only with the CD command.[/list]
Plz look here: http://ghisler.ch/board/viewtopic.php?t=22676
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

jb wrote:Can you really pass for example %$PERSONAL%\Test.txt to a compare tool on your machine?
MVV wrote:I can launch:
%$PERSONAL%\MessageBox.exe (test app, message box shows)
%$PERSONAL%\Santa.swf (system asks an application 'cos .swf not registered)
"%$PERSONAL%\WinWars 2002.txt" (Notepad launches, long name, so works only with quotes)
You did not answer my question exactly.

Now I made another test. I created a toolbar button as follows:

Code: Select all

Command:    %$PERSONAL%\NppPortable\notepad++.exe
Parameters: %$PERSONAL%\NppPortable\license.txt
notepad++.exe is launched indeed but the parameter is not passed correctly on my machine (as already mentioned). Total Commander invokes notepad++.exe with the following command line:

Code: Select all

"C:\Dokumente und Einstellungen\jb\Eigene Dateien\NppPortable\notepad++.exe" PERSONALNppPortable\license.txt
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

jb wrote:

Code: Select all

Command:    %$PERSONAL%\NppPortable\notepad++.exe
Parameters: %$PERSONAL%\NppPortable\license.txt
notepad++.exe is launched indeed but the parameter is not passed correctly on my machine (as already mentioned)...
Enviroment variables in parameter field always needs double percent sign to distinguish the TC variables %P,%N,.. from enviroment variables:
%%$PERSONAL%% should work as expected.

Regards
Holger
jb
Senior Member
Senior Member
Posts: 412
Joined: 2003-02-09, 22:56 UTC
Location: Switzerland

Post by *jb »

HolgerK wrote:Enviroment variables in parameter field always needs double percent sign to distinguish the TC variables %P,%N,.. from enviroment variables:
%%$PERSONAL%% should work as expected.
With

Code: Select all

Command:    %$PERSONAL%\NppPortable\notepad++.exe
Parameters: %%$PERSONAL%%\NppPortable\license.txt
Total Commander invokes

Code: Select all

"C:\Dokumente und Einstellungen\jb\Eigene Dateien\NppPortable\notepad++.exe" %$PERSONAL%\NppPortable\license.txt
Actually this result does not surprise me because %% is used to escape the evaluation of an environment variable. But in this case TC is supposed to expand %$PERSONAL% because only TC knows the definition.
Post Reply