aker wrote:UNC-Support for cmd was added somewhere in the Windows 10 area (at least as far as I know). Older OSes such as Windows 7 don't support directly calling scripts on UNC-paths.
I've been calling batch scripts on UNC paths since Windows 2000. What doesn't work, is setting the working directory when a batch script is called from a UNC path - doing that leads to the "error" message luisop mentioned.
Test case. Batch scripts like these two:
- Code: Select all
@echo off
call \\server\share\test.cmd
- Code: Select all
@echo off
echo this is a test
pause
where the first one is located on a local drive. When executed, I get the message "this is a test" just fine. Even if I move the first script to the share itself, I get the message. Modifying the first script to something like
- Code: Select all
@echo off
call %~dp0test.cmd
and executing it directly from the share also shows this message, it's only preceded by the "error" message:
- Code: Select all
CMD.EXE wurde mit dem oben angegebenen Pfad als aktuellem Verzeichnis gestartet.
UNC-Pfade werden nicht unterstützt.
Stattdessen wird das Windows-Verzeichnis als aktuelles Verzeichnis gesetzt.
Actually it's not an error message, just a warning that the working directory is set to the Windows directory, that's all.
In short: I'm not sure if you mean something else. One thing I do know for sure: %~dp0 also works in Windows 2000 with UNC paths, hence my suggestion above. However, I guess that the current implementation of client\Update.cmd may break my suggestion as well, because Update.cmd tries to CD to client\cmd directory (which fails with UNC paths) and then tries to start DoUpdate.cmd without specifying its path. A better implementation of Update.cmd would be (and I think I posted something similar a while ago):
- Code: Select all
@echo off
cd /D "%~dp0cmd"
start "" "%~dp0cmd\DoUpdate.cmd" %*
Also a pushd/popd combination instead of a CD would work (pushd automatically maps network shares when required). The important thing is to specify absolute paths wherever possible to avoid ambiguities (or even calling the wrong script/program).
Regards
Dalai