Re: Copying Files / Created Date

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Michael Harris \(MVP\) ("Michael)
Date: 02/02/05


Date: Tue, 1 Feb 2005 16:20:33 -0800


> I have a script that checks whether a file on the server is newer
> than the a version on the machine from which the script is run.
> If the file on the server was created more recently than the one on
> the local machine, it replaces the the file on the local machine with
> the newer copy.
>
> This sounds to me like a reasonable process, except it is falling down
> because the creation date on the local machine version of the file
> isn't being updated. I thought I would deal this by deleting the
> local version of the file and then copy the server one to the local
> location. The problem persists and even though the local file is
> deleted and replaced with a newer version from the server, once the
> file has been copied it still keeps the Created Date from the
> original file that has been deleted.
>
> ...

This has been discused before in the scripting NGs...

That's Windows at work ;-)... The process of updating an existing file by
deleting it then creating a new file (or renaimg some temp file) with the
same name as the original is very common among apps that edit documents.

If that sequence occurs within 15 seconds, Windows treats it as an update of
an existing file. To defeat that behavior, you have to intoduce at least a
15 second delay between the delte of the old file and the creation of the
new file of the same name.

-- 
Michael Harris
Microsoft MVP Scripting 


Relevant Pages

  • Re: System Environment Variables
    ... computer has ever had is Windows XP professional. ... also tried a script that Pete Dashwood posted here last July, ... I downloaded  the express version of SQL Server 2008 to ... If you use Fujitsu COBOL you need to install it on ...
    (comp.lang.cobol)
  • Re: Windows/Macro Language Info?
    ... The point is that malware is often using Windows _features_. ... I totally understand the difference between client and server side (and you ... subverted by script code (the facilities to change file size, dates, etc. ...
    (comp.lang.cobol)
  • RE: NFS on w2k3 server question
    ... new Windows 2K3 server and it will work properly after migrating from ... Window NT4.0 to Windows 2K3. ... logon script migration is specific to how the logon ... it is recommended that you contact Microsoft Customer Support ...
    (microsoft.public.windows.server.migration)
  • Re: Windows 2008 Limitlogin
    ... We are using windows 2008 64 bit Enterprise, we are trying to limit concurrent user login using limit login but unfortunetely always fail. ... I'm one of the people that Paul was referring to who has written a script to control concurrent sessions. ... It currently prevents regular users from logging in more than once by first warning them of where their other session exists and then uses WMI to log the user off forcefully. ... For admins who log in to Windows Server, a separate perl script that ties into a 3rd party perl module must be used because for some reason WMI on Server is ignored. ...
    (microsoft.public.windows.server.active_directory)
  • RIS prestaging problem
    ... When trying to prestage Windows XP clients in a Windows 2003 Server ... The script also sets the Remote ...
    (microsoft.public.win2000.setup)