I'm trying to convert the following unix shell script to windows:
for strWorkerDirectory in $BASEDIR/worker01/applogs $BASEDIR/worker01/filtered $BASEDIR/worker01/filtered/error-logs $BASEDIR/worker01/filtered/logs $BASEDIR/worker01/filtered/session-logs
do
if [ ! -d $strWorkerDirectory ]; then
mkdir -p $strWorkerDirectory
fi
done
So far, I came up with this:
FOR %%strWorkerDirectory IN (%BASEDIR%worker01\applogs %BASEDIR%worker01\filtered %BASEDIR%worker01\filtered\error-logs %BASEDIR%worker01\filtered\logs %BASEDIR%worker01\filtered\session-logs) DO
(
IF exist %%strWorkerDirectory ( echo %%strWorkerDirectory exists ) ELSE ( mkdir %%strWorkerDirectory && echo %%strWorkerDirectory created)
)
but i'm getting an error message which just says something is wrong here
"%strWorkerDirectory" kann syntaktisch an dieser Stelle nicht verarbeitet werden.
What would be the correct conversion here?