Skip to content

Instantly share code, notes, and snippets.

@gblmarquez
Created October 30, 2020 01:08
Show Gist options
  • Save gblmarquez/740a2769dd64cf0bee13b53ffea6d292 to your computer and use it in GitHub Desktop.
Save gblmarquez/740a2769dd64cf0bee13b53ffea6d292 to your computer and use it in GitHub Desktop.
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
:: Extract date fields - language dependent
FOR /f "tokens=1-4 delims=/-. " %%i in ('date /t') do (
SET v1=%%i& SET v2=%%j& SET v3=%%k
IF "%%i:~0,1%%" gtr "9" (SET v1=%%j& SET v2=%%k& SET v3=%%l)
FOR /f "skip=1 tokens=2-4 delims=(-)" %%m in ('echo.^|date') do (
SET %%m=!v1!& SET %%n=!v2!& SET %%o=!v3!
)
)
:: Final set for language independency (English and Portuguese - maybe works for Spanish and French)
SET year=%yy%%aa%
SET month=%mm%
SET day=%dd%
MKDIR 1-People
MKDIR 2-Taxation
MKDIR 3-Treasury_Finance
MKDIR 4-Planning_Control_Analysis
REM People
MKDIR 1-People\1-Employees
MKDIR 1-People\2-Payrolls
MKDIR 1-People\2-Payrolls\%year%
FOR %%M IN (01 02 03 04 05 06 07 08 09 10 11 12) DO (
MKDIR 1-People\2-Payrolls\%year%\%year%-%%M
MKDIR 1-People\2-Payrolls\%year%\%year%-%%M\A-Reports
MKDIR 1-People\2-Payrolls\%year%\%year%-%%M\B-Obligations
MKDIR 1-People\2-Payrolls\%year%\%year%-%%M\C-Benefits
MKDIR 1-People\2-Payrolls\%year%\%year%-%%M\D-Admission_Dismissal_Vacation
)
REM Taxation
MKDIR 2-Taxation\%year%
FOR %%M IN (01 02 03 04 05 06 07 08 09 10 11 12) DO (
MKDIR 2-Taxation\%year%\%year%-%%M\A-Inbound
MKDIR 2-Taxation\%year%\%year%-%%M\B-Outbound
MKDIR 2-Taxation\%year%\%year%-%%M\C-Reports
MKDIR 2-Taxation\%year%\%year%-%%M\D-Taxes
)
REM Treasury_Finance
MKDIR 3-Treasury_Finance\1-Investiments
MKDIR 3-Treasury_Finance\2-Loans
MKDIR 3-Treasury_Finance\%year%
FOR %%M IN (01 02 03 04 05 06 07 08 09 10 11 12) DO (
MKDIR 3-Treasury_Finance\%year%\%year%-%%M\A-Statements
MKDIR 3-Treasury_Finance\%year%\%year%-%%M\B-Receipt
MKDIR 3-Treasury_Finance\%year%\%year%-%%M\C-Records
MKDIR 3-Treasury_Finance\%year%\%year%-%%M\D-Account_Control
MKDIR 3-Treasury_Finance\%year%\%year%-%%M\E-Collection
)
REM Planning_Control_Analysis
MKDIR 4-Planning_Control_Analysis\%year%
MKDIR 4-Planning_Control_Analysis\%year%\A-Planning_Budgeting_Forecasting
MKDIR 4-Planning_Control_Analysis\%year%\B-Metrics_Measures
MKDIR 4-Planning_Control_Analysis\%year%\C-Financial
MKDIR 4-Planning_Control_Analysis\%year%\D-Accounting
ENDLOCAL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment