Page 1 of 1 1
Topic Options
#20823 - 2002-04-29 03:14 PM XCOPY /D doesn't work :-(
orest Offline
Lurker

Registered: 2002-04-29
Posts: 4
Loc: Lviv, Ukraine
XCOPY started from script with /D switch doesn't work -- it copies all files instead of newer only. The same command from .bat file runs pretty well. What's wrong?
_________________________
sy, orest

Top
#20824 - 2002-04-29 03:16 PM Re: XCOPY /D doesn't work :-(
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Orest,

Welcome to the board !

can you show us the line in question ?

have you used shell '%ComSpec% /C ... ' ?

Jochen
_________________________



Top
#20825 - 2002-04-29 03:19 PM Re: XCOPY /D doesn't work :-(
orest Offline
Lurker

Registered: 2002-04-29
Posts: 4
Loc: Lviv, Ukraine
It looks like this:

Shell "cmd xcopy /S /d \\someserver\someshare\somedir\*.*

C:\aaa\*.*"
_________________________
sy, orest

Top
#20826 - 2002-04-29 03:32 PM Re: XCOPY /D doesn't work :-(
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
You need to specify a date, unless you do so all files are copied !

/d:12-29-99

As well you might want to replace cmd with %ComSpec% /c as this points always, no matter what OS to a valid command interpreter

hth

Jochen
_________________________



Top
#20827 - 2002-04-29 03:44 PM Re: XCOPY /D doesn't work :-(
orest Offline
Lurker

Registered: 2002-04-29
Posts: 4
Loc: Lviv, Ukraine
dear Jochen

I do NOT need to specify date, date is optional -- please take a look at xcopy help:
Copies files and directory trees.

XCOPY source [destination] ... [/D[:date]] ...
/D:m-d-y ... If no date is given, copies only those files whose
source time is newer than the destination time.

After all it works from command prompt and in batch file.
_________________________
sy, orest

Top
#20828 - 2002-04-29 04:06 PM Re: XCOPY /D doesn't work :-(
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Yeah sorry ...

you're right !

No need to specify date .... just a tick, will check the need of additional environment space (/e:) for cmd

J.
_________________________



Top
#20829 - 2002-04-29 04:25 PM Re: XCOPY /D doesn't work :-(
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
hmmm ... the following did update only the scriptfile after modifying in folder test :

code:
shell '%ComSpec% /C xcopy /s /d c:\winnt\profiles\jpols\Desktop\test c:\test\'

Only thing I can think of is that xcopy asks you w/o you recognizing if destination is a file or a folder [Confused]

Jochen
_________________________



Top
#20830 - 2002-04-29 04:54 PM Re: XCOPY /D doesn't work :-(
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
I just tried it in Windows 2000 with a simple

code:
shell "xcopy /S /d \\server\share\folder c:\temp"

It worked like a champ.. didn't need a CMD... With the CMD /C worked fine as well.

So, I can't duplicate the problem..

Brian

Top
#20831 - 2002-04-29 11:17 PM Re: XCOPY /D doesn't work :-(
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

We have test your script. Following works in our situation:

code:
shell '%comspec% /c xcopy /d /s "\\someserver\someshare\somedir\*.*" "c:\aaa\"'

The big differences are
- "%comspec%" instead of "CMD"
- use "c:\aaa\" instead of "c:\aaa\*.*"
greetings.

btw: we advise to use as additional XCOPY options /Y /C /R /I /H
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#20832 - 2002-04-30 09:51 AM Re: XCOPY /D doesn't work :-(
orest Offline
Lurker

Registered: 2002-04-29
Posts: 4
Loc: Lviv, Ukraine
Thanks to all involved in discussion.
It works.
_________________________
sy, orest

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 302 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.059 seconds in which 0.023 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