简体   繁体   中英

Using a batch file to create folder and copy files into it to multiple PCs

I have a folder with numerous files that I need to copy to multiple PCs on a network. I thought if the folder didn't exist it would automatically create it. Here's what I have...

copy "C:\\Documents and Settings\\follag\\Desktop\\Music" "\\PC NAME\\c$\\Documents and Settings\\All Users\\Desktop\\Music"

When I look at the destination PC, it is not creating the folder and copying the files. I'm new to this whole batch files and would appreciate any help.

Thanks,

Greg

尝试

xcopy "C:\Documents and Settings\follag\Desktop\Music" "\PC NAME\c$\Documents and Settings\All Users\Desktop\Music" /E /I

You only have a single backslash at the start of your second argument instead of two. Don't know if that's just a typo when copying here to SO. If not, then there's your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM