Sorry to bring this one back up, but i am get having issues with this one.
I am using the following and it is not return how i believe it should.
for /f "delims=:" %%A in ("%time%") do if %A LSS 12 (echo Good morning!) else (echo Good afternoon!)
Is returning:
Good Afternoon!
Its before 12pm here and it should display "Good morning!". I modified the code Helpmeh sent. Can you please explain how this is not working. I added a "%" before the "%A" after "delims=:"
Thanks everyone!
EDIT: I figured it out. Sorry. Just an FYI...I added another % to the other "%A".
New working code:
for /f "delims=:" %%A in ("%time%") do if %%A LSS 12 (echo Good morning!) else (echo Good afternoon!)