Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon Script

Status
Not open for further replies.

mot98

MIS
Joined
Jan 25, 2002
Messages
647
Location
CA
Hi All,

I need to add some code to a logon script that will copy a directory from the local drive onto the network. I want it only to copy new files though.

Is there a way to do this? Kind of like an incremental copy.

TIA for any help on this one.. mot98
[pc]

"Every day I learn something new, and forget 10 things I learned long ago!"
 
If you have the resource kit check out ROBOCOPY.exe.
 
Need it to run from a win95 machine and copy the files to the NT 4.0 server. Looks like Robocopy will only run on NT.

Any other programs out there?

I thought xcopy might work, but I can't see a differential switch.

mot98
[pc]

"Every day I learn something new, and forget 10 things I learned long ago!"
 
Actually xcopy does have a switch...

/D will only copy files with a more recent modified date than the existing destination files.
 
Hi Mot98

I just copy /? on 98se2 and no /d in the usage screen

Is it a hidden copy feature, or maybe NT only?

J
 
Mot,

Try doing XCOPY /?

You should see both the /D that meastaugh1 mentioned as well as /U

I bolded the switches that you might want...

As far as I can see XCOPY does not do the normal human thing fur 'Update':

Copy new and changed files, please.

and it does NOT remove files that are gone, like a decent mirror package, which one wants for bakcing up users.

----------------------------------



[tt]

Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/W]
[/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U]
[/K] [/N]

source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies files with the archive attribute set,
doesn't change the attribute.
/M Copies files with the archive attribute set,
turns off the archive attribute.
/D:date Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
/P Prompts you before creating each destination file.
/S Copies directories and subdirectories except empty ones.
/E Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.
/W Prompts you to press a key before copying.
/C Continues copying even if errors occur.
/I If destination does not exist and copying more than one file,
assumes that destination must be a directory.

/Q Does not display file names while copying.
/F Displays full source and destination file names while copying.
/L Displays files that would be copied.
/H Copies hidden and system files also.
/R Overwrites read-only files.
/T Creates directory structure, but does not copy files. Does not
include empty directories or subdirectories. /T /E includes
empty directories and subdirectories.
/U Updates the files that already exist in destination.
/K Copies attributes. Normal Xcopy will reset read-only attributes.
/Y Overwrites existing files without prompting.
/-Y Prompts you before overwriting existing files.
/N Copy using the generated short names.

[/tt]
 
MOT98,

Being between positions I wrore up something that copies only files that are
- not on the target
- different las modify dates
- different sizes,
the traditional update function.

I am pretty tired of MS not supporting the classic Update except by calling it briefcase. Yawn.

If you want to try it I'll send along the EXE and the source so you know it is not tainted (smile). Its only 160 lines or so long.

If it works well it shold be a boon to server admins and their users. I'll make it open source and then others can do a better job.

lemme know if you like,

jnicks@roninsg.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top