1.

Solve : A Path with date variables?

Answer» HELLO everyone.

I would like to OPEN a folder with DATE variables inside.

How can I do that ?

Example I am trying

Y:\Folder\%yyyy%\%mm%.%yyyy%\

where yyyy is the year of the system (windows 8.1) and mm is the month

Y:\Folder\2017\08.2017

Best Regards
Here we go :
Code: [Select]echo off
Title GET DateTime with Wmic
for /f "tokens=2 DELIMS==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YYYY=%dt:~0,4%"
set "MM=%dt:~4,2%"
set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%"
set "Min=%dt:~10,2%"
set "Sec=%dt:~12,2%"
Set "DateTimeVar=%YYYY%%MM%%DD%%HH%%Min%%Sec%"
echo YYYYMMDDHHMinSec = %DateTimeVar%
echo Y:\Folder\%yyyy%\%mm%.%yyyy%\
pauseThanks a lot Hackoo

Best Regards


Discussion

No Comment Found