This forum uses cookies. Click X button to hide this message. What is stored? 
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to use WinCommander on a dual booted system?
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) Printable version
View previous topic :: View next topic  
Author Message
brian
Junior Member
Junior Member


Joined: 24 Sep 2003
Posts: 51

PostPosted: Wed Sep 13, 2017 9:49 am    Post subject: how to use WinCommander on a dual booted system? Reply with quote

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 Wink)
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

_________________
We say Windows Commander because it has a COMMAND over Windows.
Checkout how it won, here! polldaddy. com/poll/810222/
First comment = the missus! ;)


Last edited by brian on Wed Sep 13, 2017 10:42 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 5568
Location: Meiningen (Südthüringen)

PostPosted: Wed Sep 13, 2017 10:27 am    Post subject: Reply with quote

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
_________________
#101164 Personal licence
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups


Last edited by Dalai on Wed Sep 13, 2017 11:32 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
brian
Junior Member
Junior Member


Joined: 24 Sep 2003
Posts: 51

PostPosted: Wed Sep 13, 2017 10:37 am    Post subject: Reply with quote

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 say Windows Commander because it has a COMMAND over Windows.
Checkout how it won, here! polldaddy. com/poll/810222/
First comment = the missus! ;)
Back to top
View user's profile Send private message Visit poster's website
Hacker
Moderator
Moderator


Joined: 06 Feb 2003
Posts: 10548
Location: Bratislava, Slovakia

PostPosted: Wed Sep 13, 2017 10:51 am    Post subject: Re: how to use WinCommander on a dual booted system? Reply with quote

brian,
Quote:
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.
Back to top
View user's profile Send private message Send e-mail
brian
Junior Member
Junior Member


Joined: 24 Sep 2003
Posts: 51

PostPosted: Wed Sep 13, 2017 10:58 am    Post subject: Reply with quote

@hacker
https://sk.wikipedia.org/wiki/Re%C4%8Dn%C3%ADcka_ot%C3%A1zka
https://en.wikipedia.org/wiki/Rhetorical_question
_________________
We say Windows Commander because it has a COMMAND over Windows.
Checkout how it won, here! polldaddy. com/poll/810222/
First comment = the missus! ;)


Last edited by brian on Wed Sep 13, 2017 11:42 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 5568
Location: Meiningen (Südthüringen)

PostPosted: Wed Sep 13, 2017 11:42 am    Post subject: Reply with quote

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
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
brian
Junior Member
Junior Member


Joined: 24 Sep 2003
Posts: 51

PostPosted: Wed Sep 13, 2017 11:47 am    Post subject: Reply with quote

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 say Windows Commander because it has a COMMAND over Windows.
Checkout how it won, here! polldaddy. com/poll/810222/
First comment = the missus! ;)
Back to top
View user's profile Send private message Visit poster's website
Hacker
Moderator
Moderator


Joined: 06 Feb 2003
Posts: 10548
Location: Bratislava, Slovakia

PostPosted: Wed Sep 13, 2017 12:49 pm    Post subject: Reply with quote

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

Or you could subst 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.
Back to top
View user's profile Send private message Send e-mail
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 5568
Location: Meiningen (Südthüringen)

PostPosted: Wed Sep 13, 2017 12:53 pm    Post subject: Reply with quote

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:
[DirMenu]
menu1=&Music
cmd1=cd G:\Music
you could use this
Code:
[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:
@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%".

Quote:
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
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
brian
Junior Member
Junior Member


Joined: 24 Sep 2003
Posts: 51

PostPosted: Wed Sep 13, 2017 1:27 pm    Post subject: Reply with quote

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. Smile
_________________
We say Windows Commander because it has a COMMAND over Windows.
Checkout how it won, here! polldaddy. com/poll/810222/
First comment = the missus! ;)
Back to top
View user's profile Send private message Visit poster's website
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 5568
Location: Meiningen (Südthüringen)

PostPosted: Wed Sep 13, 2017 2:25 pm    Post subject: Reply with quote

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.

Quote:
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:
@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
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
brian
Junior Member
Junior Member


Joined: 24 Sep 2003
Posts: 51

PostPosted: Thu Sep 14, 2017 8:45 am    Post subject: Reply with quote

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:
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
_________________
We say Windows Commander because it has a COMMAND over Windows.
Checkout how it won, here! polldaddy. com/poll/810222/
First comment = the missus! ;)


Last edited by brian on Thu Sep 14, 2017 9:14 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Hacker
Moderator
Moderator


Joined: 06 Feb 2003
Posts: 10548
Location: Bratislava, Slovakia

PostPosted: Thu Sep 14, 2017 9:14 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 5568
Location: Meiningen (Südthüringen)

PostPosted: Thu Sep 14, 2017 9:41 am    Post subject: Reply with quote

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
Athlon X4 880K, 16 GiB RAM, Gigabyte F2A88X-D3HP, Win7 x64

Plugins: Services2, Startups
Back to top
View user's profile Send private message Send e-mail
Hacker
Moderator
Moderator


Joined: 06 Feb 2003
Posts: 10548
Location: Bratislava, Slovakia

PostPosted: Thu Sep 14, 2017 10:01 am    Post subject: Reply with quote

Dalai,
Quote:
unfortunately it wouldn't help for TC's directory history because that saves absolute paths

Well then perhaps subst, 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.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Total Commander (English) All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group