B
B
bychok3002017-03-13 14:20:02
cmd/bat
bychok300, 2017-03-13 14:20:02

How to create a file from bat with current date?

Tried like this: echo . > "C:\Folder Name\log%DATATIME%.txt"
and like this:

echo . > "C:\Folder Name\log" + %DATATIME% + ".txt"

so : echo . > "C:\Folder Name\log"%DATATIME%".txt"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fat Lorrie, 2017-03-13
@bychok300

%DATE%

K
Konstantin Tsvetkov, 2017-03-13
@tsklab

echo . > "C:\FolderName\log-%date:~6,4%-%date:~3,2%-%date:~0,2%.txt"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question