Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to get a file's modified date/time and size in bytes?
#8
(05-22-2024, 03:05 PM)madscijr Wrote:
(05-22-2024, 02:29 PM)euklides Wrote: Well, for a single file, you can use this...
(Here the code do not test if the file exist !)

Thanks, I will give that a try when at the computer!

(05-22-2024, 02:37 PM)SMcNeill Wrote: wmic DataFile where "Name='D:\\Path\\To\\myfile.txt'" get LastModified /VALUE
Thanks - is this a command line thing? Can you show how to get that in a variable in a QB64PE program?

Code: (Select All)
Shell "wmic DataFile where " + Chr$(34) + "Name='Z:\\foo.pdf'" + Chr$(34) + " get LastModified /VALUE > temp.txt"
_Delay .5
Open "temp.txt" For Input As #1
Do
    Line Input #1, temp$
    Print temp$
Loop Until EOF(1)
Close

You may get the results back in wide format, so you might want to strip spaces out, depending on your OS settings.
Reply


Messages In This Thread
RE: how to get a file's modified date/time and size in bytes? - by SMcNeill - 05-22-2024, 03:33 PM



Users browsing this thread: 8 Guest(s)