At work every morning I have to create multiple file folders (using a YYYYMMDD date format as the file folder name) in different directories across our network for various departments. This is a real pain, and time waster and I would like to automate the process. So my question is. Does anyone know how can i write a script that uses the current system date in YYYYMMDD format, and creates multiple folders in different network directories with each folder named as the date in YYYYMMDD format? Thanks in advance for your answers.
feedback
|
|
Create a batch file that looks like this:
Warning: the format of the date (yyyymmdd=%%k%%j%%i) depends on your regional settings. Because I use the French date format (dd/mm/yyyy), I have to use "%%k%%j%%i" as the format (%%i = day, %%j = month, %%j = year). If your regional settings are set to US style (mm/dd/yyyy), you should use "%%k%%i%%j" (%%i = month, %%j = day, %%j = year). If you want to include the time as well, use this:
The date is stored in the variable You could use a separator between the date and time: | |||||||
feedback
|
|
Another, uglier but much more flexible way, is to generate a separate batch file for every directory that needs to be created, that (a) creates the directory and (b) renames the next batch file that needs to be executed to a previously selected common name. You just run a batch file with that common name every day | |||
|
feedback
|