Map your Nextcloud server to a Windows drive letter with NcDavTray

NcDavTray — Tiny Nextcloud WebDAV Tray for Windows

Windows WebDAV tray watcher + watchdog (PowerShell 5.1 + WinForms)

Release License PowerShell 5.1

Map your Nextcloud server to a real Windows drive letter (e.g. Z:) and keep it healthy.
NcDavTray is a small, self‑contained tray app written in Windows PowerShell 5.1 + WinForms and a small amount of embedded C# for DPI and shell notifications (usually present on every Windows system). It runs without admin rights and supports both Installed and Portable modes.


Features

  • One‑click drive mapping to a persistent letter (your choice)

  • Auto‑reconnect & auto‑cleanup if the server is offline or in maintenance mode, the letter changes its color

  • Optional subfolder mapping (map any folder from within your nextcloud server)

  • Friendly Explorer appearance (custom label & icon from your Nextcloud favicon)

  • Tray UI:

    • left click: status balloon
    • right click / context menu: Connect now, Disconnect (pause), Open in Explorer, Settings, About, Exit
  • Two security models:

    • Installed: credentials protected with Windows DPAPI (bound to your user profile)
    • Portable: credentials encrypted with AES‑256 + PBKDF2 (passphrase you choose)
  • Watchdog for clean unmount if the app (or USB stick in portable mode) disappears

  • WebClient tuning tab: inspect and adjust the underlying Windows WebDAV redirector (WebClient) limits and timeouts with safe defaults, inline help texts and UAC-guarded “Apply changes” button.

  • WebDAV cache tab: monitor the Windows WebDAV redirector cache in real-time, view cached items, clear them manually or auto-wipe on exit via the elevated cache watcher.

  • Multi‑language (i18n) with live switching and simple JSON language packs:

    • builtin
      • English
    • i18n file:
      • German
      • Spanish
      • French
      • Italian
      • Dutch
      • Portuguese (Brazil)
    • (More to come, translators welcome)

Requirements

  • Windows 10 / 11 with Windows PowerShell 5.1 (the provided launcher starts PS 5.1 in STA automatically)
  • WebClient service available & enabled (Windows WebDAV mini‑redirector)
  • Nextcloud reachable via HTTPS (connection uses a Nextcloud App Password)

No administrator rights are required except for optional optimizations to the WebClient service and the cache‑watcher feature.


Install/Update & Quick Start

  1. Download the latest ZIP from the repository’s Releases page on github.

  2. Extract the ZIP to a folder in your user profile.

  3. Run installNcDavTray.cmd and choose:

    • 1 — Installed mode: copies the app into your profile (%LOCALAPPDATA%\NcDavTray), sets optional per‑user auto‑start (configurable in Settings), creates Start Menu/Desktop shortcuts, and safely stops + restarts any running instance while preserving your config.
    • 2 — Portable mode: creates a self‑contained portable package in the selected folder. Launch it via the generated Start NcDavTray.cmd.

Enjoy!

ernolf

5 Likes

Love it, installed it under installed mode (option 1) and an icon shows in the tray to tell me to open settings with the exclamation mark. However which settings? Nothing shows when right-clicking the icon in the tray what normally provides you with settings.
Had a look into the installed folder, but there is no settings.json file, just the language JSONs.
What am I missing?

Hi @RdedR,

thank you very much for your reply!

Yes. Normaly the settings dialog should open automaticaly on the first run or at least you should become a right-klick-contextmenu with the option to open Setup.

If this persists, even after a restart of windows, could you please open an issue on https://github.com/ernolf/NcDavTray/issues with as much information as possible about your windows version, environment, the role of your windows user etc., since I am not able to reconstruct that behaviour.
There I can ask more specific questions and instructions how to debug. That would be a great help!

ernolf

1 Like

A restart did the trick. Thanks.

The window it opens looks a bit squeezed though:

to help me diagnose the cramped UI layout you’re seeing, please do the following:

  1. Open Windows PowerShell (x64).
  2. Copy-paste the script below into the console and press Enter.
  3. Send me the entire output.
  4. Additionally, please attach two screenshots:
  • Settings → System → Display: the page that shows the Scaling (%) for the monitor where the app window appears (if you have multiple monitors, one screenshot per monitor).
  • Settings → Accessibility → Text size: the percentage value shown there.

No admin rights are needed. The script is read-only and does not change anything.

Thanks!


Script (copy-paste into Windows PowerShell (x64))

# NcDavTray - Font/DPI environment probe (single-block)
# This script is read-only and does not change any settings.

$ErrorActionPreference = 'SilentlyContinue'
Add-Type -AssemblyName System.Drawing

# OS / basic
$os    = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'
$arch  = (Get-CimInstance Win32_OperatingSystem).OSArchitecture

# Accessibility / text size & high contrast
$acc   = Get-ItemProperty 'HKCU:\Software\Microsoft\Accessibility'
$hc    = Get-ItemProperty 'HKCU:\Control Panel\Accessibility\HighContrast'
$desk  = Get-ItemProperty 'HKCU:\Control Panel\Desktop'

# Fonts registry & substitutions
$sub   = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes'
$reg   = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts'

# Installed font families (runtime)
$installed = [System.Drawing.Text.InstalledFontCollection]::new().Families | Select-Object -Expand Name

function Get-FontMap([string]$name) {
  if ($sub.PSObject.Properties.Name -contains $name) { "$name => " + $sub.$name } else { "$name => <not set>" }
}
function Get-FontReg([string]$name) {
  if ($reg.PSObject.Properties.Name -contains $name) { $reg.$name } else { "<missing>" }
}

# What WinForms would actually use at runtime
$probeTahoma = (New-Object System.Drawing.Font('Tahoma', 9)).Name
$probeShell2 = (New-Object System.Drawing.Font('MS Shell Dlg 2', 9)).Name

# Tahoma files present on disk (optional)
$tahomaFiles = Get-ChildItem 'C:\Windows\Fonts\tahoma*' -ErrorAction SilentlyContinue |
               Select-Object -Expand Name

$report = [PSCustomObject]@{
  OS_Version              = "$($os.DisplayVersion) (Build $($os.CurrentBuild).$($os.UBR))"
  Edition                 = $os.EditionID
  Architecture            = $arch
  UILanguage_Region       = ((Get-WinSystemLocale).Name + " | " + (Get-Culture).Name)
  Text_Size_Percent       = if ($acc.TextScaleFactor) { "$($acc.TextScaleFactor)%" } else { "100% (default)" }
  HighContrast_Flags      = $hc.Flags
  FontSub_MS_Shell_Dlg    = Get-FontMap 'MS Shell Dlg'
  FontSub_MS_Shell_Dlg_2  = Get-FontMap 'MS Shell Dlg 2'
  FontSub_Tahoma          = Get-FontMap 'Tahoma'
  Reg_Tahoma_Regular      = Get-FontReg 'Tahoma (TrueType)'
  Reg_Tahoma_Bold         = Get-FontReg 'Tahoma Bold (TrueType)'
  Installed_Tahoma        = ($installed -contains 'Tahoma')
  Installed_MSSansSerif   = ($installed -contains 'Microsoft Sans Serif')
  Installed_SegoeUI       = ($installed -contains 'Segoe UI')
  Probe_Tahoma_Runtime    = $probeTahoma
  Probe_ShellDlg2_Runtime = $probeShell2
  Tahoma_FontFiles_OnDisk = if ($tahomaFiles) { ($tahomaFiles -join '; ') } else { "<none found>" }
}

$report | Format-List *

ernolf

Version 1.1.0:

Add tabbed Settings dialog and WebClient tuning tab

  • Switch Settings dialog to a tabbed layout (Basic / WebClient tuning)
  • Add WebClient tuning tab for WebDAV WebClient limits and timeouts with UAC-guarded “Apply changes”
  • Improve dirty tracking for Settings and WebClient tuning values
  • Tweak labels, layout and tooltips; fix several minor UI issues

To upgrade from a previous version..

  • Update (Installed): download the new ZIP and run installNcDavTray.cmd → choose 1. The running instance is stopped and restarted automatically; your configuration is preserved.
  • Update (Portable): run installNcDavTray.cmd → choose 2 and point to your existing portable folder. Your *_portable.json and *_secret.dat are kept.

ernolf

1 Like

Version 1.1.1:

Handle disabled WebClient service more clearly and add Italian i18n

  • Track when the WebClient service start type is set to “Disabled” and expose it via ServiceDeactivated
  • Reflect the disabled-service state in the tray icon and status texts so users see why the drive cannot be mapped
  • Add explicit warning text that points users to the “WebClient tuning” tab when the service is disabled
  • Do some minor cleanup around the WebClient tuning/UI code and remove no-longer-used bits
  • Add a complete Italian translation JSON, including WebClient tuning, tray, and service-related strings

To upgrade from a previous version..

  • Update (Installed): download the new ZIP and run installNcDavTray.cmd → choose 1. The running instance is stopped and restarted automatically; your configuration is preserved.
  • Update (Portable): run installNcDavTray.cmd → choose 2 and point to your existing portable folder. Your *_portable.json and *_secret.dat are kept.

ernolf

NcDavTray 1.1.2 — Maintenance & Stability Release

This release focuses exclusively on reliability improvements and correctness fixes.
No new features are introduced; this version is intended as a stable baseline before the upcoming 1.2.x feature series.

:check_mark: Fixes

  • Fixed Nextcloud folder picker
    A whitespace-related regression caused malformed OCS URLs (depth = …, path = …) which prevented descending into subfolders.
    The picker now works as in 1.0.x again.
  • Improved Watchdog isolation
    The Watchdog process is now scoped to the calling script’s PID, preventing cross-instance interference and enabling multiple NcDavTray instances to run concurrently, each with its own dedicated Watchdog.
  • More robust unmapping behavior
    The Watchdog now re-loads configuration before unmapping and responds more reliably to sudden USB drive removal in portable mode.

:check_mark: Cleanup

  • Removed accidental trailing spaces across the script.
  • Minor internal refactoring with no behavioral changes.

Full Changelog: Comparing v1.1.1...v1.1.2 · ernolf/NcDavTray · GitHub


Steps to upgrade from a previous version..

  • Update (Installed): download the new ZIP and run installNcDavTray.cmd → choose 1. The running instance is stopped and restarted automatically; your configuration is preserved.
  • Update (Portable): run installNcDavTray.cmd → choose 2 and point to your existing portable folder. Your *_portable.json and *_secret.dat are kept.

ernolf

NcDavTray v1.2.0

This release introduces a full WebDAV Cache Watcher & Cleaner, integrated directly into the Settings UI.

:new_button: New

  • WebDAV Cache Tab
    • Displays all files currently stored in the Windows WebDAV cache (SYSTEM-scoped WebClient cache).
    • Shows name, size, modification time & entry type for better visibility and understanding.
    • Can be started/stopped from any instance – the watcher runs elevated when needed.
    • Shared across all running NcDavTray instances (single watcher for the machine).
  • One-click cache cleanup
    • Immediate Clear Cache button to wipe all cached WebDAV files.
    • Optional privacy feature: Clear cache on exit
      If enabled, the watcher wipes the cache automatically when the last NcDavTray instance closes.

:light_bulb: Why this matters

  • Windows normally cleans WebDAV cache opportunistically, but not always perfectly.
    This feature lets advanced users observe, control and reset the cache on demand,
    helpful for troubleshooting performance issues, large file usage, or when working on shared PCs.


With this release, NcDavTray now includes every feature I personally consider essential.
Please test it thoroughly — especially the new WebDAV Cache Watcher — and let me know how it performs for you.
Feedback is highly appreciated, whether you are a power user with improvement ideas or simply enjoy the tool as it is.
I’d love to hear from both sides.

If I’m not mistaken, this is currently the smallest Nextcloud WebDAV tray client for Windows — roughly 180 KB in size. It can’t compete with the official desktop client in terms of features, but it also doesn’t dig deep into the OS and is fully removable within seconds (unlike the ~160 MB official sync client, which is a p.i.t.a. to completely uninstall).

If you like it, please spread the word and help others discover it too.


ernolf

NcDavTray v1.2.1 — A small but handy update! :rocket:

:new_button: New

  • Added a new menu option to open the mapped drive.
    You can now open your mapped drive straight from the tray. No more hunting around Windows Explorer. :tada:

:white_check_mark: Fixes & Cleanup

  • A few small gremlins were caught and removed. :bug::water_pistol:

ernolf

2 Likes