REFERENCE / 01

UNC path vs. mapped drive

A drive letter is a convenient alias, not a portable network address. Separate the address from the account running your work.

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, Status

Read 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.

USEMAPPED DRIVEUNC PATH
Daily browsingShort, familiar shortcutExplicit host and share
Sharing instructionsNeeds the mapping explainedNames the intended resource
AutomationMay be absent in its sessionAvoids dependence on the letter
PermissionStill requiredStill 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.

  1. Confirm the actual UNC root using the working session. Replace only the path reference in your script, not the task’s security settings.
  2. 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.
  3. 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.