Have you tried mapping the NAS folders to a virtual drive in Windows? It then appears as a "normal" drive letter to all apps and can be accessed as such.
I do that, but since my NASes are SMB1, Windows can be finicky about reconnecting them, so I wrote an app to remake the connections. (Even then, I have to restart Windows sometimes before it'll work - Windows really doesn't want you yo use SMB1 any more.)
The code is C#, but it's pretty obvious - it uses the "net use" windows cmd app to remove and remake a connection as this was the most reliable way I found (previously working WIN32 calls failed in Win10 and Win11 when SMB1 support was depreciated):
private static void Connect(string drive, string path)
{
for (int attempts = 3; attempts > 0; attempts--)
{
if (attempts != 3) Thread.Sleep(5000);
Process process = new Process();
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.FileName = "net";
process.StartInfo.Arguments = $"use {drive} /delete";
process.Start();
process.WaitForExit();
process = new Process();
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.FileName = "net";
process.StartInfo.Arguments = $"use {drive} {path}";
process.Start();
process.WaitForExit();
DriveInfo di = new DriveInfo(drive.Substring(0, 1));
if (di.IsReady) return;
}
Storage.WriteLog($"Unable to connect {drive} to \"{path}\" after three attempts");
}