I'm trying to figure out how to make a batch file to create a folder+subfolder in an entire directory of individual folders.
Initially I was just asked to make a batch file to create a folder + subfolder if it did not exist, I assumed my boss would have this run on startup and came up with the following after reading around on SO for a while.
@echo off
@break off
@title Create Folder with Batch
setlocal EnableDelayedExpansion
if not exist "H:\minecraftedu\saves\" (
mkdir "H:\minecraftedu\saves\"
if "!errorlevel!" EQU "0" (
echo Folder created successfully
) else (
echo Error while creating folder
)
) else (
echo Folder already exists
)
pause
exit
However what was actually needed was to make a command that we could run from the server to create
\\server\home\Students\2018(every folder in here)\minecraftedu\saves
as well as
\\server\home\Students\2019(every folder in here)\minecraftedu\saves
Which I have no idea how to do, or if that is even possible with a batch file. The end goal is to have the students Minecraftedu worlds save to their server space instead of locally, which my plan was to use symlink to have it target the folder on the server for whichever user was logged in.
I'm on staff for my hardware abilities and programming kind of escapes me past incredibly basic stuff, so any help is appreciated!
pushdto access a network path, it creates a temporary drive letter which points to that, and it changes to the root of that drive; finally, usepopdto clean up the drive letter, and to return to the previous working directory...