Welcome to the TechSpot OpenBoards. Please read the FAQ if you have any questions. Sign up or Login to participate.
|
|||||||
Download Now:
Batch file to synchronize folders over a network
|
|
Thread Tools | Search this Thread |
|
#1
|
||||
|
||||
|
Batch file to synchronize folders over a network
Right now I've got a batch file to backup from My Documents to a networked drive at work. But I was wondering if there was a way to do this, but check to see if a file has been deleted. I have gotten rid of some files in my documents and they are still on my network drive. If I don't delete them from both at the same time I forget which ones they are.
Anyway, I know this is possible with a 3rd party software, but I wanted to get it done throught his batch file if at all possible, since it is a work computer and I'm not supposed to install anything onto it This is what I am currently using. @echo off :: variables set drive=j:\ set backupcmd=xcopy /s /c /d /e /h /i /r /k /y echo ### Backing up My Documents... %backupcmd% "%USERPROFILE%\My Documents" "%drive%" :: use below syntax to backup other directories... :: %backupcmd% "...source directory..." "%drive%\...destination dir..." echo Backup Complete! @pause |
|
#2
|
|||
|
|||
|
You would not need that at all, if you would set the J-drive's %USERPROFILE%\My Documents as your default in your PC.
(unless your network is slooooowww, or not always available). Check if your company has Ontrack's (or V-Com's now) Powerdesk (Explorer replacement) available, that has built-in folder synchronisation. Laplink can do the same. Your current batchfile cannot do that, there are simply no switches for that in xcopy. |
|
#3
|
|||
|
|||
|
hi,
i dont think xcopy supports network, though: 1. (if you can) program in VB then you can use the built in functons and make a full standalone app or even an invisible app.... 2. (alternative) make it copy to a big data stick/hdd with all the backup stuff on it 3. you could setup mirroring im not entirly sure who or where youcan get the service it just exists.... j4m32, |
|
#4
|
||||
|
||||
|
Maybe a program like this would do what you want:
http://sourceforge.net/projects/dirssync Edit: sorry just realised you said you didn't want to use an app |
|
#5
|
||||
|
||||
|
Thanks for the suggestions, I don't think an open source program would be a problem. I'll give that a look, but I think I have figured out how I will do it. It's not efficient, but it works.
|
|
|
|
#6
|
||||
|
||||
|
Poertner;
My Batch work is rusty ,but I do have a command line /Scipt manual .So I will look this up if you want me to. In the meantime,If these files(the ones you want to delete) always have the same name or can sit in the same Directory( Therefore you can state them as a variable) You can parse for their existence, then Goto your Xcopy command eg. for iterator (initialization variable and a set of files to execute against) do (Command) If I understand your needs correctly this should work. |
|
#7
|
||||
|
||||
|
SyncBack...
patio.
|
![]() |
| Similar Topics | ||||
| Topic | Replies | Forum | ||
Batch file to turn off network password prompt in Vista
|
5 | Windows OS | ||
Utility to Synchronize Folders Between Devices
|
3 | Software Apps | ||
Batch File to Map Network Drives
|
2 | Windows OS | ||
batch file help
|
0 | Windows OS | ||
batch file
|
10 | Software Apps | ||
| Thread Tools | Search this Thread |
|
|
All times are GMT -4. The time now is 03:53 AM.



Batch file to turn off network password prompt in Vista