Start with the mapping, not a guess
Suppose Z: maps to \\fileserver\finance. Then Z:\Reports\October.xlsx refers to \\fileserver\finance\Reports\October.xlsx. Another user’s Z: may refer somewhere else. A converter cannot infer that relationship from the letter alone.
On the Windows machine where the drive works, inspect its SMB mapping in PowerShell:
Get-SmbMapping -LocalPath 'Z:' |
Select-Object LocalPath, RemotePath, StatusRead RemotePath as the mapped root and append the part after Z:\. No result means this check did not find an SMB mapping for that letter in this context; do not invent a server name. Microsoft: Get-SmbMapping.
| USE | MAPPED DRIVE | UNC PATH |
|---|---|---|
| Daily browsing | Short, familiar shortcut | Explicit host and share |
| Sharing instructions | Needs the mapping explained | Names the intended resource |
| Automation | May be absent in its session | Avoids dependence on the letter |
| Permission | Still required | Still required |
“Explorer works; my scheduled task fails”
Windows drive letters belong to logon sessions. A service or process in another session does not inherit the mappings you see on your desktop, even when the account name is the same. Microsoft recommends UNC names for services, with the appropriate access rights. Microsoft: services and redirected drives.
- Confirm the actual UNC root using the working session. Replace only the path reference in your script, not the task’s security settings.
- Check the account and logon method configured for the task. An S4U logon has no network access; substituting a UNC string does not change that. Ask your administrator for an appropriate approved identity rather than putting passwords in scripts. Microsoft: task logon types.
- Use the following read-only checks in the execution context being diagnosed. A successful check from your own terminal is not proof that the task can access the same resource.
whoami Get-Item -LiteralPath '\\fileserver\finance\Reports\October.xlsx' -ErrorAction Stop
The first command identifies the current account. The second requests the item, not a copy or deletion. An access-denied result calls for an identity/permission review; a not-found result calls for checking the exact address and connectivity. Keep the error text, timestamp, and execution context together. Microsoft: Get-Item.
Choose the right fix
Changing Z: to UNC solves a naming dependency. It does not grant share or file-system rights, establish a VPN, or guarantee that a task’s logon supports remote access. Avoid broad “fixes” such as granting everyone access or embedding credentials. A useful handoff to your administrator includes the UNC path, the task account, whether interactive access works, and the exact error—without passwords.
Next: open the UNC address directly, or use the guided connection checks.