A very small Windows tray app for connecting and disconnecting network drives. It sits under the hidden icons in the taskbar. Right-click the icon to see your drives by their friendly names and drive letters, click one to connect it (or disconnect it if it is already connected), and choose Edit to manage the list.
It supports three ways of signing in to a share: your current Windows login, a user name and password, or a smartcard and PIN. It is a single .exe that needs no installer and no administrator rights.
Run NetDriveTray.exe. The icon appears in the taskbar notification area, usually under the ^ arrow. Right-click it for the menu:
- Each drive is listed as
Display name (Z:). A check mark means it is connected. Hovering shows the path and, for connected drives, which sign-in was used. - Click a drive to connect it. Click a checked drive to disconnect it.
- Edit... opens the drive list editor (double-clicking the icon does the same).
- Diagnostics... shows what this Windows session can see: the smartcard services, the readers, and the card certificates in your Personal store.
- Start with Windows turns on a per-user startup entry.
- Exit closes the app.
In the editor, Add creates a drive and Remove deletes one. Each drive has:
- Display name: the name shown in the menu.
- Drive letter: only letters that are free are offered.
- Network path: in the form
\\server\share. The server can be a short name, a full name or an IP address. Names are looked up through DNS only; network broadcast lookups are never used, because another computer on the local network could answer to a short name. If DNS resolves a short name, the connection is made to the full name DNS returned. - Sign in with: current Windows login, user name and password, or smartcard and PIN.
- Test connection: checks that the server name resolves, that the server answers on the file sharing port, and that sign-in works. For smartcard drives it also shows the card that will be used: certificate name, issuer, expiry, provider and, when the card driver reports it, the reader.
For a smartcard drive, pick the certificate on the card from the list (insert the card and click Refresh if it is not shown). The drive remembers that certificate, so each drive is tied to its own card. The app asks for the PIN in its own small dialog (naming the card) each time it connects, passes it to Windows for that one connection, and does not save it. The prompt also shows the server path and the address that answered, and is only shown once the server responds.
Only cards that are actually inserted are offered. Windows can keep a card's certificate in your Personal store after the card is removed, so the app checks that the card is really readable (without asking for a PIN) before treating it as present. To see or forget cards that are no longer inserted, tick "Show saved cards that are not inserted" in the editor, select one and click Remove. That deletes Windows' stored copy of the certificate and clears the card from the drive; nothing on the card changes, and inserting it again brings it back.
Because cards get swapped, auto-connect is tied to the card:
- Connect automatically when this card is inserted mounts the drive only when its own card is detected, at start-up or on insertion. It tries once per insertion, so disconnecting a drive by hand does not cause it to reconnect.
- Disconnect this drive when the card is removed is optional and off by default.
- In the menu, a smartcard drive whose card is not inserted is greyed and marked
card not inserted.
Windows allows only one set of credentials per server at a time, which matters when swapping cards. If a connect fails for that reason, the app lists the other drives on that server and offers to disconnect them first.
The card shown for a connected drive is the one this app used when it mounted the drive. For drives mapped some other way, Windows does not say which card was used.
When a drive can't be connected, a window explains in plain language what went wrong and lists a few things to try, with a Copy details button for IT. The checks run in stages (server name, file sharing port, sign-in) so the message points at the stage that failed, for example VPN not connected, wrong card, wrong PIN, drive letter already used, or a conflicting connection to the same server.
The drive list is %APPDATA%\NetDriveTray\drives.dat. It is encrypted with your Windows account's own key, so another account, or a copy of the file on another PC, cannot read it (code running as you still can; see SECURITY.md), and it holds names, letters, paths, user names and certificate thumbprints but no passwords. The folder is restricted to your account and the system. Saved passwords go in Windows Credential Manager under entries named NetDriveTray:<id>, and a saved password is only released for the share and user name it was saved for. A PIN is never saved. Unexpected errors are logged to error.log, and a record of connects, disconnects, tests and settings changes (never a PIN, password or thumbprint) is kept in audit.log, both in the same folder.
See SECURITY.md for what the tool protects, how, and where its limits are, including what a formal assessment would still need. Running NetDriveTray.exe /selftest checks that the protections are in force and that every Windows call the program relies on works; the result is written to %TEMP%\NetDriveTray-selftest.txt.
If an exe is not allowed on a machine, or you prefer something you can read and edit in Notepad, the script folder has a PowerShell version: insert the card, double-click NetDrives.cmd, and the drives listed inside that one file are mapped. It has no tray icon or editor window. See script/README.md.
Grab NetDriveTray.zip from the Releases page. Unzip it and run NetDriveTray.exe. If you would rather not run a prebuilt exe, the Building section below shows how to make your own from the source.
The simplest option is to run NetDriveTray.exe from any folder you can write to. To install it for your account only:
NetDriveTray.exe /install
This copies it to %LOCALAPPDATA%\Programs\NetDriveTray and adds a Start menu shortcut. To remove it:
NetDriveTray.exe /uninstall
It needs .NET Framework 4.7.2 or later, which is included with Windows 10 (1803 and later) and Windows 11. The exe is not code-signed, so a managed PC may show a SmartScreen prompt or block it by policy.
The build uses the C# compiler that ships with Windows, so no SDK, Visual Studio or administrator rights are needed.
Requirements
- A Windows 10 or Windows 11 PC. The build does not run on macOS or Linux, because it relies on the Windows C# compiler and Windows-only libraries.
- Windows PowerShell 5.1, which is included with Windows.
- .NET Framework 4, whose compiler (
csc.exe) is already part of Windows at%WINDIR%\Microsoft.NET\Framework64\v4.0.30319.
Steps
-
Get the source: use Code > Download ZIP on the GitHub page and unzip it, or run
git clone. -
Open PowerShell in the project folder (in File Explorer, click the address bar, type
powershelland press Enter). -
Run the build script:
powershell -ExecutionPolicy Bypass -File build.ps1 -
Collect the results from the
distfolder:File What it is NetDriveTray.exeThe tray app, a single file NetDriveTray.zipThe exe with this README and SECURITY.mdNetDriveTray-Script.zipThe PowerShell script version and SECURITY.md -
Check the build by running
NetDriveTray.exe /selftest. It writes its result to%TEMP%\NetDriveTray-selftest.txt.
If build.ps1 reports that the compiler was not found, confirm that the v4.0.30319 folder above exists. If PowerShell blocks the script, the -ExecutionPolicy Bypass flag in step 3 applies only to that one run and changes no setting on the PC.
The source is in src. The tray icon is resources\hard_drive_network.png, an original drawing generated by resources\make-icon.ps1 (run it with -Out path\to\file.png to regenerate). The dist folder in this repository holds a prebuilt copy, so you only need to build if you change the source or want to produce the exe yourself.