Assign the network share a temporary drive letter and work on that:
NET USE Z: \\192.168.1.100\01-SCHEMA
mkdir z:\%date:~-4,4%_%date:~-7,2%_%date:~0,2%
NET USE Z: /DELETE
Or a bit easier, let PUSHD / POPD do the same for you:
PUSHD \\192.168.1.100\01-SCHEMA
mkdir %date:~-4,4%_%date:~-7,2%_%date:~0,2%
POPD
Another possibility, from a now deleted comment, is to use the entire network path in the command:
mkdir \\192.168.1.100\01-SCHEMA\%date:~-4,4%_%date:~-7,2%_%date:~0,2%
Update/Follow-up: The general way in this situation - as asked - would be to evaluate all network shares and iterate over them. If you're sure that you really want to include all shares, use the code below (needs to be put in a .bat file). Use NET VIEW \\192.168.1.100 to check the list of shares beforehand.
@ECHO OFF
SET HOST=192.168.1.100
FOR /F "tokens=1" %%G IN ('NET VIEW \\%HOST% ^| FINDSTR Disk') DO (
MKDIR "\\%HOST%\%%G\%date:~-4,4%_%date:~-7,2%_%date:~0,2%"
)
Follow-up #2: In order to programatically create the folder over/on a network share independent of the actual network path, this single line will suffice:
MKDIR "%~dp0%date:~-4,4%_%date:~-7,2%_%date:~0,2%"
It works because %~dp0, which is expanded to drive letter and path of the currently running script, will give you the UNC-path if run from a network share. So this solution does more or less resemble method #3 of the first part of this answer.
\\192.168.1.100\...instead of\192.168.1.100\.... For example,md "\\192.168.1.100\...\your folder"pushdsupports UNC paths, typepushd /?to find out how it works...