Free Power Tools Brochure
Get Mark Minasi's
17-page guide today!



      

advertisement

Get Newsletters

  • Get the Latest News
  • Product Updates
  • Helpful Tricks
  • Productivity Tips

Subscribe Now!

September 13, 2004 07:13 PM

JSI Tip 8460. How can I modify a files timestamp?

Rating: (0)
Windows IT Pro
InstantDoc ID #81784


If you wish to set a files 'date modified' timestamp to the current date and time, you can use native commands. To modify the 'date modified' timestamp of H:\Folder\FileName.ext:

pushd H:\Folder
copy /b /y "FileName.ext" +,,
popd

NOTE: The archive bit is NOT set.

If you wish more control, use Touch.exe:

===============================================================================

Description: Touch displays or sets the created, access, and modified times of one or more files.

-------------------------------------------------------------------------------

Touch for Win32, Version 1.0
Freeware by Steve P. Miller (stevemil@pobox.com).  Copyright 1997.
Visit http://pobox.com/~stevemil for the latest version and other utilities.

Usage: touch [/s] [/h] [/p] [/q] [/v] [/c] [/m] [/a] [/r file]
             [/d mm-dd\[-[cc]yy]] [/t hh\[:mm\[:ss\[.ms]]]] filespec ...

  /s Process subdirectories.
  /h Process hidden/system files/directories.
  /p Prompt for each file (Yes/No/All/Quit). Ignored in view mode.
  /q Quiet mode; Only display errors; Ignored in view mode.
  /v View mode; Display times rather than set times.
  /c View/set created time.
  /m View/set modified time; Default if /a and /c are not specified.
  /a View/set accessed time.
  /r Reference file; Use this file's date and time to set other files.
  /d Date: month, day, century, year.
  /t Time: hour (0-24), minutes, seconds, milliseconds.

In view mode (/v), the /p, /q, /r, /d, and /t options are ignored.
In set mode, the default is to use the current date and time.
Use the /r, /d, and/or /t options to override the default set time.
The century (cc) is assumed to be 19 for years 69-99, and 20 for years 00-68.



ARTICLE TOOLS

Add a Comment

There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here

VB Script to enable user account

Do any of you guys have a VB script that could be used to enable a AD user account? We are setting up a "firecall" ID which will stay disabled until i...222-96219

advertisement

GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS

Podcasts

To successfully implement virtual desktops, IT administrators must carefully match user requirements to specific desktop technologies. Listen to this podcast to learn what you need to keep in mind when formulating your approach to desktop virtualization.

Downloads

PacketTrap IT is a comprehensive and affordable network management and application monitoring solution that solves problems associated with bandwidth, network and application performance, and connectivity. Gain insight into your network - try PacketTrapIT free for 21 days!

Web Seminars

Aside from its employees, data is an organization’s most important resource. Join Windows technical specialist and 11-time MVP John Savill to learn the best practices for managing data using features in Windows Server.
View this web seminar on demand!

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.