Skip to main content

"UNC path not supported" when running Batch File in post/pre command

June 4, 2025

Product Version

AhsayACB/AhsayOBM: 7.3.0.0 - 7.17.x

Operating System

Windows

Symptom

When performing a backup job on AhsayOBM/AhsayACB the following error is shown in the backup log, if a Windows batch file is run as a pre or post backup command from a network drive or UNC path.

No.TypeTimestampLog
*.........
*infoYYYY/MM/DD hh:mm:ss[Pre-Backup-1] xxxx.bat
*warnYYYY/MM/DD hh:mm:ss'\\UNC_PATH\folder\'
*warnYYYY/MM/DD hh:mm:ss[Pre-Backup-1] CMD.EXE was started with the above path as the current directory.
*warnYYYY/MM/DD hh:mm:ss[Pre-Backup-1] UNC paths are not supported. Defaulting to Windows directory.
*warnYYYY/MM/DD hh:mm:ss[Pre-Backup-1] 'xxxx.bat' is not recognized as an internal or external command,
*warnYYYY/MM/DD hh:mm:ss[Pre-Backup-1] operable program or batch file.
*.........

Cause

The warning message is returned by Microsoft Windows and not Ahsay, it is related to Windows limitation which prevents the running of batch files on UNC paths.

Resolution

A workaround for this Windows limitation is to use a batch file located on a local drive along with the pushd and popd commands to launch the batch file on the network drive.

Example:

Batch File: \\192.168.22.41\Production\current\shutdown_database.bat

  1. Create an batch file and save on local machine to execute the batch file on UNC path or network drive.
  2. Call the local batch file (localbatch.bat) in the pre or post backup command in AhsayOBM/AhsayACB.

    localbatch.bat

    echo on
    pushd \\192.168.22.41\Production\current\
    \\192.168.22.41\Production\current\shutdown_database.bat
    popd
    

    unc-path-not-supported-batch-file-error-01.png