Is it possible to write a Batch File that will automate creating New Sub Folders-New Folders need to be created each day in several Directories in the following Format:-
for /f "tokens=2 delims= " %%a in ('date /t') do set dtemp=%%a
for /f "tokens=1-3 delims=/" %%a in ("%dtemp%") do (set month=%%a& set day=%%b& set year=%%c)
for /f "tokens=2 delims=0" %%a in ("%year%") do set year=%%a
md %day%.%month%.0%year%
; end
Notes:
. a script would have been easier than a batch file
. You can either CALL this from a batch file that CD's into all the subfolders; or use this once in a template folder and then use XCOPY /T /E to repeatedly call this to duplicate the directory structure of the template folder to other folders
Also, make sure you open notepad and paste the above into a file, to be called some_filename.bat
You cannot run each line outside of a .bat file to have it make sense.
Thanks,
Is it possible to use the same variables that create a folder based on the Current Date to rename folders to 'Filename_Current Date'-tried using the same commands with the rename command but this has not worked.
I have tried this command to rename a file but it is not working correctly e.g
tried to rename a file called ab.txt to ab15032005.txt and when the file is run the file is renamed to ab....txt-any suggestions as to what could be the problem is appreciated.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.