Windows Server - Xcopy - "M" switch question
Asked By JohnB
23-Jan-10 10:40 AM
This is probably considered OT for this group, but I did not see where else
to ask it, and I know there are some people here that use batch files a lot.
I have this command: xcopy c:\MyFiles\*.* F:\Backup\*.* /S /Y /M
(there are a lot of sub-folders)
But it backs up the entire contents of the folder, everytime. The files are
photos. Nothing has changed. I ran it the first time without the "M"
switch. But after adding that switch it still backs up every single file.
Any ideas?
Thanks.
Directory
(1)
Xcopy
(1)
Lab
(1)
Starters
(1)
DOCTYPE
(1)
Attrib
(1)
CMD
(1)
DTD
(1)
Dusko Savatovic replied to JohnB
Probably because archive (A) attribute is set on every single file.
You can check in CMD console with a command:
attrib
Richard Mueller [MVP] replied to Dusko Savatovic
Possibly the archive bit is not being reset when you run the program, as it
should, because you have permission to copy, but not permission to modify in
the source folder. Otherwise, you might try the /D switch, which will only
copy if the source is newer than the target. Also, you might try RoboCopy.
This is available in newer OS's and is very powerful.
--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--
Jonathan de Boyne Pollard replied to JohnB
http-equiv="Content-Type">
did not see where else to ask it, [...]<br>
F:\Backup\*.* /S /Y /M </code><br>
(there are a lot of sub-folders) But it backs up the entire contents of
the folder, everytime. The files are photos. Nothing has changed. I ran
it the first time without the "M" switch. But after adding that switch
it still backs up every single file.<br>
whether the attribute was turned off and really is still off? Prove
that the attribute is being turned off and is remaining off.<br>
permissions in active directory Windows Server Greetings i have an Active Directory Installed on the network but i am getting problems to share files as i cannot http: / / forums.techarena.in / members / hasnain.htm View this thread: http: / / forums.techarena.in / active-directory / 1131225.htm http: / / forums.techarena.in Windows Server Active Directory Discussions Active Directory (1) Lab (1) Printers (1) Robocopy (1) Xcopy (1) Bits (1) Hello hasnain, What share permission and what NTFS permission did you configure if necessary, you can enable File and Print sharing on the workstation. - - Richard Mueller MVP Directory Services Hilltop Lab - http: / / www.rlmueller.net - - Greetings Meinolf. well i have not changed any
Xcopy not working in startup script Windows Server This is driving me nuts and I have of who logs in. = = = = = = = = = = = = = = = = = = = = = = = = = if NOT exist "C: \ Templates" md "C: \ Templates" pushd " \ servername \ Templates \ " xcopy *.dot C: \ Templates / Y / D popd = = = = = = = = = = = = = = = = = = = = = = = = = The script works perfectly when run by itself, but is not found. = = = = = = = = = = = = = = = = = = = = = = = = = File not found - *.dot 0 File(s) copied = = = = = = = = = = = = = = = = = = = = = = = = = When I replace the xcopy with a regular copy command, it works during startup but I need to only copy the files when there are newer templates on the server and thus have to use xcopy. I have confirmed that the computer has permisisons to copy from the server share (it pushd commands to no avail, i.e. = = = = = = = = = = = = = = = = = = = = = = = = = if NOT exist "C: \ Templates" md "C: \ Templates" xcopy \ servername \ Templates \ *.dot C: \ Templates / Y / D = = = = = = = = = = = = = = = = = = = = = = = = = The error message is the same, it says file not found. And I have confirmed that xcopy is working on the target machine. Like I said, it works fine on it's many hours trying to figure out this silly little problem. Windows Server Discussions XP (1) Xcopy (1) Lab (1) Permisisons (1) Locatable (1) Directory (1) Cookies (1) Unmaps (1) It is almost certainly
Would someone know the location from which the script runs? - - Thanks, Jeff Windows Server Active Directory Discussions Hanisco (1) Windows (1) Chicago (1) Jeff (1) Ryan (1) Lab (1) Xxxxxxxxxxxx (1) Directory (1) Jeff, Where exactly did you put the script? If is in the machine policy and you only have user rights to the directory / file then it will never run because machine scripts are run before the user environment everyone find the info they need quickly. Hi Ryan, I placed the script in the directory. I have tested the script manually from a few test clients and it runs with a problem and updates the file. It's a simple xcopy batch file and doesn't do anything more than copy a file to the client scripts: http: / / www.rlmueller.net / LogonScriptFAQ.htm - - Richard Mueller Microsoft MVP Scripting and ADSI Hilltop Lab - http: / / www.rlmueller.net - - That's exactly what I did. Thanks for the link, I
Simple Active Directory Directory Sharing Problem Windows Server This has got to be simple, but I've yet to at which point, of course, everyone has access. What am I missing? Windows 2000 Active Directory Discussions Active Directory (1) LearnQuick (1) USERName (1) DOMAINN (1) CACLS (1) NTFS (1) MCSE (1) MVP (1 Herb Martin, MCSE, MVP http: / / www.LearnQuick.Com (phone on web site) keywords: Simple, Active, Directory, Directory, Sharing, Problem description: This has got to be simple, but I've yet to figure