Answer the question
In order to leave comments, you need to log in
How to fix a condition on the command line?
@echo off
set VDATE=%date:~-10%
set VTIME=%time:~0,-3%
cd C:\Users\Asus\Desktop
@echo %VDATE% %VTIME%>tida.txt
if %VTIME:~0,2% geq 12 copy tida.txt tida.bak || @echo %VDATE% %VTIME%>tida.txt else @echo %VDATE%
@pause
Answer the question
In order to leave comments, you need to log in
@echo off
set VDATE=%date:~-10%
set VTIME=%time:~0,-3%
echo %VDATE% %VTIME% >> test.txt
if %VTIME:~0,2% geq 12 (copy test.txt test.bak || echo %VDATE% %VTIME% >> test.txt) else echo %VDATE%
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question