How to run batch file from network share without “UNC path are not supported” message?

PUSHD and POPD should help in your case.

@echo off
:: Create a temporary drive letter mapped to your UNC root location
:: and effectively CD to that location
pushd \\server\soft

:: Do your work
WP15\setup.exe
robocopy.exe "WP15\Custom" /copyall "C:\Program Files (x86)\WP\Custom Templates"
Regedit.exe /s WPX5\Custom\Migrate.reg

:: Remove the temporary drive letter and return to your original location
popd

Type PUSHD /? from the command line for more information.

Leave a Comment