Суббота , 17 апреля 2021
Home / Администрирование / Windows / Резервное копирование данных с помощью bat-файла и планировщика Windows.

Резервное копирование данных с помощью bat-файла и планировщика Windows.


Создаем bat файл:

 Откройте мой компьютер и создайте на диске C:\ папочку test.

      — Зайдите в неё и создайте в ней папку testcopy.

(Для наглядного примера, перенесем в нее любые файлы.) Далее нам надо создать, сам bat файл по нажатию на который у нас будет происходить копирование папки C:\test1\testcopy в, скажем, папку D:\test1\backup. (Создавать вторую папку (которая backup) не надо — она будет появляться автоматически.)


Добавляем в файл команду для копирования:

   xcopy C:\test1\testcopy D:\test1\backup /f /i /y /s 

  • xcopy— это сама команда;
  • C:\test1\testcopy— это источник, т.е. папка откуда копируются файлы и каталоги;
  • D:\test1\backup— это результат, т.е. место, куда будут скопированы файлы и каталоги;
  • /f /i /y /s — дополнительные параметры синтаксиса для команды xcopy


  • /f — выводит имена исходных файлов и файлов-результатов в процессе копирования
  • /i— создает новый каталог в случае, если тот отсутствует в конечном пути
  • /y— перезаписывает файл в случае, если он уже есть
  • /s— копирует каталоги и подкаталоги, если они не пусты. Если параметр /s не задан, команда xcopy будет работать только с одним каталогом.




18 комментариев

  1. I really like it when folks come together and share opinions.

    Great site, stick with it!

  2. I know this site presents quality dependent posts and additional stuff,
    is there any other website which presents these stuff in quality?

  3. Howdy! I know this is kinda off topic but I was wondering which blog platform are you using for
    this site? I’m getting sick and tired of WordPress
    because I’ve had issues with hackers and I’m looking at options for
    another platform. I would be fantastic if you could point me in the direction of a good platform.

  4. I just like the helpful info you supply in your
    articles. I will bookmark your blog and test again here regularly.
    I am reasonably sure I will be told many new stuff proper right here!
    Best of luck for the following!

  5. Wonderful post but I was wanting to know if you could write a litte more
    on this subject? I’d be very grateful if you could elaborate a little bit more.

  6. This is a great tip particularly to those new to the blogosphere.
    Brief but very accurate info… Appreciate your sharing
    this one. A must read article!

  7. Asking questions are actually good thing if you are not understanding
    anything entirely, but this piece of writing offers fastidious understanding even.

  8. This is my first time pay a visit at here and i
    am really happy to read everthing at alone place.

  9. Howdy! I know this is kinda off topic but I was wondering if you knew where I could find a captcha plugin for my comment form?
    I’m using the same blog platform as yours and I’m having problems finding one?
    Thanks a lot! games ps4 185413490784 games ps4

  10. Great blog here! Also your website loads up very fast!
    What host are you using? Can I get your affiliate link to your host?
    I wish my web site loaded up as quickly as yours lol ps4 games
    185413490784 ps4 games

  11. Hi there just wanted to give you a brief heads up and let you know a
    few of the pictures aren’t loading correctly. I’m not sure why but I think
    its a linking issue. I’ve tried it in two different browsers and both show the same results.

  12. Hi, i believe that i saw you visited my weblog so i
    came to go back the prefer?.I’m attempting to find
    issues to improve my site!I guess its ok to make use of a few of your concepts!!

  13. Hello Dear, are you truly visiting this site regularly, if so
    then you will definitely get good knowledge.

  14. With havin so much content and articles do you ever run into any issues of plagorism or copyright
    infringement? My website has a lot of unique content I’ve either written myself or outsourced but it appears
    a lot of it is popping it up all over the internet
    without my permission. Do you know any methods to help reduce content from being
    ripped off? I’d certainly appreciate it.

  15. Hello! I could have sworn I’ve visited this web site before but
    after going through many of the posts I realized it’s new
    to me. Regardless, I’m definitely delighted I came across
    it and I’ll be book-marking it and checking back regularly!

  16. Hello! Do you use Twitter? I’d like to follow you if that would
    be ok. I’m definitely enjoying your blog and look forward
    to new updates.

  17. Hiya! I know this is kinda off topic but I’d figured I’d ask.
    Would you be interested in exchanging links or maybe
    guest writing a blog post or vice-versa? My site covers a lot of the same topics as yours
    and I believe we could greatly benefit from each other.
    If you’re interested feel free to send me an email. I look forward to hearing from you!

    Awesome blog by the way! asmr 0mniartist

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *