|
-
May 9th, 2002, 11:30 PM
#1
Batch File
I hope this is the right forum to ask this.
I need to write 2 simple batch files to run in Windows that will copy files from my laptop to my desktop and vice-versa on my home "network", running the batch file from my laptop. The laptop drive is C and the desktop drive is H in the laptop file tree (it is the C drive on my desktop). So each would be something like this, I think:
Copy C:\Folder 1\*.* H:\Folder 1
Copy H:\Folder 1\*.* C:\Folder 1
I would save them as seperate files with the .bat extension.
I need the batch file to automatically overwrite any files. I also want to copy more than one folder to another folder, as Folder 2 to Folder 2, and 3 to 3, ect, w/just one batch file. I don't know how to do either of these things. Any help is appreciated.
Harold
-
May 10th, 2002, 08:23 AM
#2
Registered User
I think for what you want to do, it would work better with xcopy. Here's some examples:
xcopy c:\Folder1\*.* h:\Folder1\ /s/y/h/q
/s - Copies folder structure (only use if you happen to have subfolders)
/y - Stops prompts for overwriting
/h - Copies all hidden and system files too
/q - Turns off the copy display so file names aren't flashing across screen (personal preference)
Repeat this command for each folder you wish to copy. Then just create a second batch as you indicated and reverse the source and destination to copy from the laptop back to the desktop.
Choosing the best method to accomplish what you are talking about varies greatly on the Operating systems you are using. OSs have sync utilities built into them, so that route might be better than a couple of batch files.
A bored admin is a very dangerous person...
-
May 11th, 2002, 07:17 AM
#3
D,
That looks perfect. Thanks much.
Harold
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|
Bookmarks