Page 1 of 1 1
Topic Options
#156970 - 2006-02-09 04:46 PM Copying files based on date...
Bobmc Offline
Fresh Scripter

Registered: 2006-02-09
Posts: 8
Very new to Kix...
I've got a set of files that I want to copy from a network location to the end user PC. Curently I'm running this in the kix script:
copy "\\servername\public\adminfiles" "%SystemDrive%\Program Files\Admin System"
The copy works but it copies it every time they login, I want to change this so that it only copies files to the local PC if the files on the PC are older then the ones on the network server. I have an bat file that I was using before but it using xcopy with the /d and we can't use xcopy within the kix script. Could I get some segguestions on what is the best way to do this, do some kind of compare or do a shell command or what. Also any examples would be very helpful as well.
Thanks in advance..

Top
#156971 - 2006-02-09 05:05 PM Re: Copying files based on date...
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Well, good news is that you in fact CAN use xcopy within the script, SHELL is your friend here.

If you still can't for some reason you could compare with Getfiletime() and copy depending on results

Questions left ?
_________________________



Top
#156972 - 2006-02-09 05:47 PM Re: Copying files based on date...
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
see the UDF FreshFile()

It is sort of a XCOPY /d /u
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#156973 - 2006-02-09 09:37 PM Re: Copying files based on date...
Bobmc Offline
Fresh Scripter

Registered: 2006-02-09
Posts: 8
When I tried the command
xcopy \\servername\public\adminfiles" "%SystemDrive%\Program Files\Admin System\" /D

It would fail. How could I use xcopy here?

Top
#156974 - 2006-02-09 09:39 PM Re: Copying files based on date...
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
there is a quote missing
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#156975 - 2006-02-09 09:42 PM Re: Copying files based on date...
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Also, XCOPY is not a KiX command so if you are trying to do it in a script, you need to SHELL or RUN to use it.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#156976 - 2006-02-09 09:42 PM Re: Copying files based on date...
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
public\adminfiles\*.*
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#156977 - 2006-02-10 10:01 AM Re: Copying files based on date...
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
shell '%ComSpec% /c xcopy "\\servername\public\adminfiles\*.*" "%SystemDrive%\Program Files\Admin System\" /D'
_________________________



Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 756 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.117 seconds in which 0.052 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org