MSFN Forum: How to retreive "Date Modified" in .cmd file? - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How to retreive "Date Modified" in .cmd file? .bat or .cmd Rate Topic: -----

#1 User is offline   brian 

  • Junior
  • Pip
  • Group: Members
  • Posts: 51
  • Joined: 17-December 03

Posted 07 January 2004 - 12:52 AM

Is there a way to retreive the "Date Modified" of a file through a .bat or .cmd file ?

Could someone show me an example ?


#2 User is offline   un4given1 

  • Elaborate Dreamer
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,796
  • Joined: 25-September 03

Posted 07 January 2004 - 06:35 AM

DIR /TW c:\file.ext


You can use a FOR statement to disect it

C:\>for /f "tokens=1" %%i IN ('dir /tw file.ext ^| find /i "file.ext"') do echo %%i


Enjoy!

(remember, variables in batch files for a FOR statement have double % ie:'%%i' where as from a cmd prompt it's single % ie:'%i')

#3 User is offline   brian 

  • Junior
  • Pip
  • Group: Members
  • Posts: 51
  • Joined: 17-December 03

Posted 07 January 2004 - 03:53 PM

Thank You, will use it tonight.

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy