Cannot Open Mapped Network Drive from WSL2 on First Launch

English support forum

Moderators: petermad, Stefan2, white, Hacker

Post Reply
llinfeng
Junior Member
Junior Member
Posts: 10
Joined: 2014-10-03, 02:18 UTC
Location: Ann Arbor

Cannot Open Mapped Network Drive from WSL2 on First Launch

Post by *llinfeng »

Attached are screenshots illustrating an issue with accessing a mapped network drive from WSL2 in TC 11.x. Specifically, when I launch TC for the first time (left), the mapped network drive (W://) is not accessible. To access it, I must open a second instance of TC.
Image: https://imgur.com/a/EpaGF1f

I keep my wincmd.ini file synchronized across all my Windows 11 computers using Dropbox. This behavior is consistent across all my devices running the following TC versions: 10.00, 11.02, and 11.50.

I’m trying to understand what makes the first launch of TC different from subsequent ones. The issue with loading mapped WSL2 shares occurs only with the first TC window. Notably, WSL2 shares are the only network drives that fail to open in this initial TC instance. In contrast, other network drives—such as a home NAS—remain accessible, even when they appear with a "disconnected network drive" icon. For example, I can still connect to my NAS drive (X:\\) without issues.

Thank you in advance!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50254
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Cannot Open Mapped Network Drive from WSL2 on First Launch

Post by *ghisler(Author) »

NOT confirmed. I restarted my PC and the mapped WSL2 drive was available from the start.
How did you create that drive? I created it via command line:
net use L: \\wsl.localhost\Ubuntu /user:username
This way it reconnects automatically.

The drive icon in your left screenshot shows me that the drive isn't connected.
Author of Total Commander
https://www.ghisler.com
llinfeng
Junior Member
Junior Member
Posts: 10
Joined: 2014-10-03, 02:18 UTC
Location: Ann Arbor

Re: Cannot Open Mapped Network Drive from WSL2 on First Launch

Post by *llinfeng »

Thank you for checking on this, and affirming that this is not happening on your side!

To confirm, I have been mapping the WSL directory using the following command and have also rebooted the machine:
net use W: \\wsl.localhost\WLinux /user:myusername

----

I found the answer to my own question: I was launching the first instance of Total Commander differently from the subsequent ones.

I used the following AHK (v1) script to start the first instance of Total Commander. However, I launched subsequent instances manually without AHK by emulating control-clicks on Total Commander's system tray icon. More specifically, since I had pinned TC as the first icon on the taskbar, I used Shift + Win + 1 to open additional instances.

Code: Select all

    RunAs, username, password
        Run "C:\Program Files\totalcmd\TOTALCMD.EXE"
    RunAs
The intention behind this approach was to launch Total Commander without admin privileges since my AHK script runs with elevated permissions. However, using RunAs in this way seems to have caused the initial instance of Total Commander to display "broken" network drives, and to completely fail at connecting to WSL directories.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50254
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Cannot Open Mapped Network Drive from WSL2 on First Launch

Post by *ghisler(Author) »

Which user do you use to run the net use command? I ask because network connections are user-specific. When TC is run as a different user than the net use command, it will not see the connection.
The intention behind this approach was to launch Total Commander without admin privileges
There is a simpler solution for this:
"%WINDIR%\explorer.exe" "C:\Program Files\totalcmd\TOTALCMD.EXE"
Author of Total Commander
https://www.ghisler.com
llinfeng
Junior Member
Junior Member
Posts: 10
Joined: 2014-10-03, 02:18 UTC
Location: Ann Arbor

Re: Cannot Open Mapped Network Drive from WSL2 on First Launch

Post by *llinfeng »

Thanks again! Launching TC through explorer.exe did the trick!

As for the user—I'll simply use the same one I log into Windows with. Nothing special. I hadn't considered this straightforward solution before—really appreciate it!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50254
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Cannot Open Mapped Network Drive from WSL2 on First Launch

Post by *ghisler(Author) »

Great, thanks for your feedback! Since this wasn't a bug, I'm moving this thread to the English forum.

Moderator message from: ghisler(Author) » 2025-02-18, 07:51 UTC

Moved to English forum
Author of Total Commander
https://www.ghisler.com
Post Reply