Batch script to read files created after 5PM

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Codesearcher
Posts: 1
Joined: 09 Mar 2019 05:31

Batch script to read files created after 5PM

#1 Post by Codesearcher » 09 Mar 2019 05:51

Hi All,
I am looking for a Batch command that can retrieve the files created in a folder after 5PM.

Eg:
List of files created on folder after 5:00:05 PM on a day while I have the date in form of string, how can I write a command to do it?
Pretty new to scripting and this forum.

Please help.

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Batch script to read files created after 5PM

#2 Post by aGerman » 10 Mar 2019 06:38

That's by far not enough information. Batch doesn't have any datatime value type. For that reason we have to treat a date and time as string anyway. But in this case the format would be important because unfortunately everything is localized. E.g. the content of the %date% variable could be something like
Sun 03/10/2019 or
2019-03-10 or
10.03.2019

What we don't know is:
a) what format does "I have the date in form of string" mean?
b) what kind of localized string does ~t format specifier of a FOR variable produce
c) "after 5:00:05 PM" until when? (Even though I don't think we would even get seconds.)

Steffen

Post Reply