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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Font Size in Threads Dimster 5 376 12-12-2025, 04:49 PM
Last Post: Dimster
  auto-detecting screen resolution for optimal window size on non-Windows systems madscijr 11 1,080 11-10-2025, 07:23 PM
Last Post: madscijr
  auto-detecting screen resolution for optimal window size on non-Windows systems madscijr 0 226 10-26-2025, 06:58 PM
Last Post: madscijr
  question on determining time spent in area fistfullofnails 9 845 08-25-2025, 01:55 PM
Last Post: fistfullofnails
  Testing against multiple elements at a time without select case CMR 4 840 04-17-2025, 02:16 AM
Last Post: CMR

Forum Jump:


Users browsing this thread: 2 Guest(s)