how to use WinCommander on a dual booted system?

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
brian
Junior Member
Junior Member
Posts: 61
Joined: 2003-09-25, 01:14 UTC
Contact:

how to use WinCommander on a dual booted system?

Post by *brian »

I bought a laptop with Win10 already installed, I now added Win 8 later on a different partition "G:\"

But, of course, when I boot up Win 8, it's NOT "G:\" but "C:\", because hello, dual booting, and what was "C:\" is now "D:\".

So, sure, i recorded a macro in Textpad to (in the Wincmd.ini file) change all "C:\" to "D:\" and all "D:\" to "C:\".
It still is annoying AF

Is there a way to:
1. Make this automated, like on startup of the program? (methinks not, but I just thought I'd ask ;))
2. Or, make a button or something, like a script which opens, changes and then saves WinCmd.ini, then restarts the program? To be sure, the script would have to be the reverse one on Windows 10


Please forgive me if this question is a duplicate. I'm so tired, it's like being drunk and i did a quick+dirty search and saw nothing like this question.

PS RegelnBumsers who like to whine how the name is not Windows Commander, are kindly asked to explain why it's called wincmd.ini and wcx_ftp.ini
Last edited by brian on 2017-09-13, 16:42 UTC, edited 1 time in total.
We call it WindowsCommander because it commands Windows, not "Total".
even though it'd be cool to command a 7 trillion dollar oil company
It won Best Alternative File Manager
http://polldaddy.com/poll/810222/
First comment = my girl! ;)
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

The question is: Where do you have a path in your wincmd.ini that would need such replacement? History? Plugins? Tabs? Button bar? Generally speaking, you should replace something like C:\totalcmd with %COMMANDER_PATH% wherever possible to make it independent from an absolute path. This works with other (environment) variables, too, e.g. a path like C:\Users\Dalai could be replaced by %HomeDrive%%HomePath%.

EDIT: Typo

Regards
Dalai
Last edited by Dalai on 2017-09-13, 17:32 UTC, edited 1 time in total.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
brian
Junior Member
Junior Member
Posts: 61
Joined: 2003-09-25, 01:14 UTC
Contact:

Post by *brian »

where? mostly in the history and in the preferential directories, to be sure. Also, the Start thing and the buttonbar.

I've installed WinCommander on the logical F-drive wihich remains the F-Drive in both instances.

PS But making the program directory universal, won't work, because (A) it's not about that one, and (B) it's already universal, as in the same under either boot option. I guess a script to change the WINCMD.INI each time is what I'm asking.

Thanks for the reply.
We call it WindowsCommander because it commands Windows, not "Total".
even though it'd be cool to command a 7 trillion dollar oil company
It won Best Alternative File Manager
http://polldaddy.com/poll/810222/
First comment = my girl! ;)
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: how to use WinCommander on a dual booted system?

Post by *Hacker »

brian,
explain why it's called wincmd.ini and wcx_ftp.ini
For compatibility reasons.

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
brian
Junior Member
Junior Member
Posts: 61
Joined: 2003-09-25, 01:14 UTC
Contact:

Post by *brian »

Last edited by brian on 2017-09-13, 17:42 UTC, edited 1 time in total.
We call it WindowsCommander because it commands Windows, not "Total".
even though it'd be cool to command a 7 trillion dollar oil company
It won Best Alternative File Manager
http://polldaddy.com/poll/810222/
First comment = my girl! ;)
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

brian wrote:I guess a script to change the WINCMD.INI each time is what I'm asking.
Why would you want to do that when you can use environment variables, as I already pointed out? You should take a look at the available variables (set command in a CMD window, and also TC's pseudo env variables) and which ones make the most sense to your situation and environment. If no variable fits your needs, you can also create your own in a script that launches TC afterwards.

And BTW: there's no need to use a TC installation on a separate drive, although this can be advantageous. Maybe UseIniInProgramDir is a better choice. There's plenty of documentation to making TC portable in this forum.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
brian
Junior Member
Junior Member
Posts: 61
Joined: 2003-09-25, 01:14 UTC
Contact:

Post by *brian »

Dalai wrote:
brian wrote:I guess a script to change the WINCMD.INI each time is what I'm asking.
Why would you want to do that when you can use environment variables, as I already pointed out? You should take a look at the available variables (set command in a CMD window, and also TC's pseudo env variables) and which ones make the most sense to your situation and environment. If no variable fits your needs, you can also create your own in a script that launches TC afterwards.

And BTW: there's no need to use a TC installation on a separate drive, although this can be advantageous. Maybe UseIniInProgramDir is a better choice. There's plenty of documentation to making TC portable in this forum.

Regards
Dalai
I keep my movies on the C-drive and my music on G-drive.
When I boot up Win8, then I can't find them from WinCmd because movies are now on D-drive and the music on C-drive.
same goes for some applications or programs.

Please explain, more slowly (more for Dummies) how variables fix that.

In my experience, a variable points to a directory, but can not deal with a changing LOGICAL DRIVE.
We call it WindowsCommander because it commands Windows, not "Total".
even though it'd be cool to command a 7 trillion dollar oil company
It won Best Alternative File Manager
http://polldaddy.com/poll/810222/
First comment = my girl! ;)
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

brian,
https://www.urbandictionary.com/define.php?term=rhetorical%20answer

Or you could [face=courier]subst[/face] them.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

brian wrote:I keep my movies on the C-drive and my music on G-drive.
When I boot up Win8, then I can't find them from WinCmd because movies are now on D-drive and the music on C-drive.
Did you change these directories in Windows or do you just use them? I.e. does "My Videos" point to the directory you have your movies in, and does "My Music" point to the directory you have your music? If so, you can simply use %$MYVIDEO% and %$MYMUSIC% respectively instead of some hard-coded path like C:\Movies or G:\Music.

Example for the directory hotlist (Ctrl+D): Instead of

Code: Select all

[DirMenu]
menu1=&Music
cmd1=cd G:\Music
you could use this

Code: Select all

[DirMenu]
menu1=&Music
cmd1=cd %$MYMUSIC%
Note that you don't need to edit your wincmd.ini manually (but use the normal edit dialog), the code is just for demonstration purposes.

If you didn't point Windows to your "My Music" and "My ..." directories, you could set your own variables in a batch script, like this:

Code: Select all

@echo off
set music_dir=G:\Music
set movies_dir=C:\Movies

REM --- Here you need to insert some condition that makes it distinct which Windows you're running
if condition (
    set music_dir=C:\Music
    set movies_dir=C:\Movies
)

start "" "%~dp0totalcmd.exe"
And in the directory hotlist just use "cd %movies_dir%".
In my experience, a variable points to a directory, but can not deal with a changing LOGICAL DRIVE.
A path can contain a drive specification, so of course variables can work around changed logical/physical drives.

One more thing: In Windows' Disk Management you can change the drive letters, so it can be done to make it more consistent across multiple installations (except Windows system partition, of course).

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
brian
Junior Member
Junior Member
Posts: 61
Joined: 2003-09-25, 01:14 UTC
Contact:

Post by *brian »

thanks for your extensive answer.
I don't use all these crap windows directory's and they are really beside the point of my question. I don't use any relative directories, only absolute ones.
Dalai wrote: (except Windows system partition, of course).
and that last bit is the crucial factor why I can't do what you suggest. Perhaps I wasn't clear. Win8 sits on G:\drive but only under win10. When I boot up Win8 it then becomes the Windows system partition aka the C-drive.

the C:\movies dir CHANGES to D:\movies after I boot up Win8

Please explain how I then make WinCmd point to D:\movies, automatically, without editing wincmd.ini, because what you suggest with variables and set won't work. Or show me how.

This could be just me (but for now, I don't think so) , so please, be patient. :)
We call it WindowsCommander because it commands Windows, not "Total".
even though it'd be cool to command a 7 trillion dollar oil company
It won Best Alternative File Manager
http://polldaddy.com/poll/810222/
First comment = my girl! ;)
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

brian wrote:I don't use any relative directories, only absolute ones.
That doesn't matter. Environment variables mostly contain absolute paths, and as I said: you can create your own variables and use them.
the C:\movies dir CHANGES to D:\movies after I boot up Win8
I have already shown how you could launch TC with a script that sets environment variables beforehand. It only needs the if condition to be filled out, something that determines which OS is running. This could be computer name, Windows version or something. Since you said you use Win8 ( 8.1 I hope) and Win10 it's really easy to fill out the if condition. Here's the full script

Code: Select all

@echo off

REM --- Variables valid for Win10
set music_dir=G:\Music
set movies_dir=C:\Movies

REM --- Variables valid for Win8.1
ver | find /i "6.3." > NUL && (
    set music_dir=C:\Music
    set movies_dir=D:\Movies
)

start "" "%~dp0totalcmd.exe"
Save the code above to a .cmd file in TC's directory (e.g. startTC.cmd), change paths as needed, point the link you're using to start TC to this script, and then you can start to change the paths in your wincmd.ini to use these variables. That's it. I hope it's clear now what all this fuss is about.

PS: IMO It's a really bad idea to keep (important) data on a system partition because it makes everything more complicated, including system backup (imaging), Windows reinstallation and so on - and the stuff this topic is about, obviously. If you had your data on a separate partition it would be much easier.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
brian
Junior Member
Junior Member
Posts: 61
Joined: 2003-09-25, 01:14 UTC
Contact:

Post by *brian »

But then I would miss all the changes in the history, too. Those are changing all every minute.

Plus, I'd have to do that for every directory in my hotlist / preferential whatever. Dozens. And also, they change a lot.

It would really be easier to have a script that ran at startup like this:

Code: Select all

IF Windows8 
then
 open WinCmd.ini
 change  WinCmd.ini
     Search+Replace "C:\" to "filler"
     Search+Replace "D:\" to "C:\"
     Search+Replace "filler" to "D:\"
 save WinCmd.ini
 start/restarts WinCmd
IF Windows10 
then
 open WinCmd.ini
 change  WinCmd.ini
     Search+Replace "D:\" to "filler"
     Search+Replace "C:\" to "D:\"
     Search+Replace "filler" to "C:\"
 save WinCmd.ini
 start/restarts WinCmd 
yeah, yeah its not code, I know.

It's not about one or two directories, indeed, i'd have moved them to F:\. if it was just that. It's about (to paraphrase Gary Oldman in 'Leon'): "EVERYTHING!"

But I don't know how:
1. the specific commands to make this script. for example how does the script detect on which OS it's running? Can it detect the labels of the logical drives? Because I've labeled them "WinTan" and "WinAte"
2. to make this script run before WinCmd runs, which is in my Startup
Last edited by brian on 2017-09-14, 15:14 UTC, edited 1 time in total.
We call it WindowsCommander because it commands Windows, not "Total".
even though it'd be cool to command a 7 trillion dollar oil company
It won Best Alternative File Manager
http://polldaddy.com/poll/810222/
First comment = my girl! ;)
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Why not make system variables and use those in all programs (not just TC)?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Well, of course it is possible to write a script that changes the paths in wincmd.ini accordingly, something that makes use of sed.exe, AHK or AutoIt or similar, but that's certainly time-consuming to do so. Furthermore there might be occurances of the paths in your wincmd.ini that should not be replaced because they relate to something else, e.g. command parameters.

@Hacker: Yes, I thought also in this direction, but unfortunately it wouldn't help for TC's directory history because that saves absolute paths...

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Dalai,
unfortunately it wouldn't help for TC's directory history because that saves absolute paths
Well then perhaps [face=courier]subst[/face], as I mentioned before?

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Post Reply