Re: Change folder date

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Michael Harris \(MVP\) ("Michael)
Date: 03/06/04


Date: Fri, 5 Mar 2004 18:13:40 -0800


> Hello all, I'm trying to find a way (with vbs) to change a folder
> date/time.

You can change the last modified date to the current date/time by creating
and deleting a temp file within the folder. To set it to a specifec
date/time you'll need to find a touch utility...

set fso = createobject("scripting.filesystemobject")
path = "c:\_temp\"
set folder = fso.getfolder(path)
msgbox folder.datelastmodified
tfile = path & fso.gettempname
Call fso.createtextfile(tfile)
fso.getfile(tfile).delete
msgbox folder.datelastmodified

-- 
Michael Harris
Microsoft.MVP.Scripting
Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp
TechNet Script Center Sample Scripts
http://www.microsoft.com/technet/scriptcenter/default.asp
Download in HTML Help format (searchable)
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942
WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en


Relevant Pages

  • Re: e-mails from Sent folder display no date when moved
    ... > showing the send date/time and the Deleted items folder showing the received ... > Delete mail from Deleted Items older than 20 days. ...
    (microsoft.public.mac.office.entourage)
  • Volume Leveling In Media Player 9
    ... thought that volume leveling and "normalizing" are essentially the same thing. ... I have seen, through Windows Explorer, that files in a specific folder are ... modified when the files are played (by the modified date/time). ... I am importing tracks by Roxio's Easy Audio Capture through ...
    (microsoft.public.windowsmedia.player)
  • How can I cause the datetime to be the name of the output file.....
    ... my data to that folder. ... automatically create a file where the filename.zip would be a date/time ... rename the file with the filename being the date/time stamp. ...
    (comp.lang.c)
  • Re: How do I get my correct date sent/received headers back?
    ... How are you getting individual inboxes and sent items for individual accounts? ... folder, and into that account's Inbox, and the displayed sent/received ... corrupt to the date/time when the message was moved. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: e-mails from Sent folder display no date when moved
    ... You're right about the distinction between having the Sent Items folder ... showing the send date/time and the Deleted items folder showing the received ... Delete mail from Deleted Items older than 20 days. ...
    (microsoft.public.mac.office.entourage)