Hi,

I need to set DateLastModified of a file. How can I do that?

I need it because I am exporting files from a SharePoint database to the
file system, and needs to set the exported files to the same date/time as
they originally had. I already know how to read the files and dates from
SharePoint.

Regards,
Peter

How to change DateLastModified og a file? by Jimmy

Jimmy
Thu Dec 04 21:07:52 CST 2003

Hi,

>-----Original Message-----
>Hi,
>
>I need to set DateLastModified of a file. How can I do
that?
>
>I need it because I am exporting files from a SharePoint
database to the
>file system, and needs to set the exported files to the
same date/time as
>they originally had. I already know how to read the
files and dates from
>SharePoint.
>
>Regards,
>Peter
>
>
>.
>

Are you sure you want to do this by a script?
Visual File Information from W2K Resource Kit can do this
job.

Regards,
Jimmy

Re: How to change DateLastModified og a file? by Peter

Peter
Fri Dec 05 10:07:37 CST 2003


"Jimmy" <jimmywonghk2000@yahoo.com.hk_NO_SPAM> wrote in message
news:000101c3badc$f8f9fc90$a001280a@phx.gbl...
> Hi,
>
> >-----Original Message-----
> >Hi,
> >
> >I need to set DateLastModified of a file. How can I do
> that?
> >
> >I need it because I am exporting files from a SharePoint
> database to the
> >file system, and needs to set the exported files to the
> same date/time as
> >they originally had. I already know how to read the
> files and dates from
> >SharePoint.
> >
> >Regards,
> >Peter
> >
> >
> >.
> >
>
> Are you sure you want to do this by a script?
> Visual File Information from W2K Resource Kit can do this
> job.
>
> Regards,
> Jimmy

I need to do it on several thousand files every night, so a script would be
preferable. ;-)

The Windows API has a SetFileTime function, but I can't find out how to call
Windows API functions from a WSH vbscript.

Regards,
Peter



Re: How to change DateLastModified og a file? by Torgeir

Torgeir
Fri Dec 05 10:43:54 CST 2003

Peter Almer Frederiksen wrote:

> I need to set DateLastModified of a file. How can I do that?
>
> I need it because I am exporting files from a SharePoint database to the
> file system, and needs to set the exported files to the same date/time as
> they originally had. I already know how to read the files and dates from
> SharePoint.

Hi

You can e.g. use touch.exe from the GNU utilities for Win32 from:
http://unxutils.sourceforge.net for this:

From: William E Hatto (weh@nospam.ozemail.com.au)
Subject: File Dates
Newsgroups: microsoft.public.scripting.vbscript
Date: 2002-07-12 07:04:40 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&th=7283f24a2b680e93


--
torgeir
Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of the 1328 page
Scripting Guide: http://www.microsoft.com/technet/scriptcenter