We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Help running Batch Files

Aiadi
Aiadi Posts: 1,840 Forumite
Hi. Having not used or come across batch files before, I have created a few of them for individual (and different) backup tasks using a program called FreeFileSync that I have been using since yesterday. Each Batch file would automatically execute a single backup task and I was wondering if it would be possible to run all these batch files in sequence rather than having to execute them (by double-clicking in my case) individually one after the other. is there any software that would automate such a process? (apart from windows task scheduler). Thanks in advance for any help.......
Do I want it? ......Do I need it? ......What would happen if I don't buy it??????
«1

Comments

  • m_13
    m_13 Posts: 990 Forumite
    Are you running Windows XP? Why not create a new batch file that calls all the others?

    Create a text file with the following syntax where you call each batch file by name in the order you want them doing. Then save it with a bat extension and the name you want that will remind you it does everything!

    @echo off
    Call batch1.bat
    Call batch2.bat
  • Aiadi
    Aiadi Posts: 1,840 Forumite
    m_13 wrote: »
    Are you running Windows XP? Why not create a new batch file that calls all the others?

    Create a text file with the following syntax where you call each batch file by name in the order you want them doing. Then save it with a bat extension and the name you want that will remind you it does everything!

    @echo off
    Call batch1.bat
    Call batch2.bat
    Thanks m_13 for the rapid reply. I am running XP (but would also like the thing to work on Vista if possible). As this whole thing is very new to me I would probably need some experimentation first. I take it the the "Call" part is some sort of the command and the following bit is the file name. Am I correct in that assumption? and if that the case then how do I point the comand to the file location?. Also the batch files created do not have the extension .bat but .!!!!!!_batch (example file name: SyncJob.!!!!!!_batch). Would that make any difference? and finally how does one run the .bat file created with notepad? Thanks again for the help.
    Do I want it? ......Do I need it? ......What would happen if I don't buy it??????
  • m_13
    m_13 Posts: 990 Forumite
    A batch file created in XP should work in Vista.

    Yes, the 'call' tells the batch file to go and find whatever follows. If your files are in various location then put in the whole path starting at c:\ or d:\ and include all folders in the path until you get to the file itself.

    It shouldn't matter that your files are not true batch files, they should launch using freefilesync do their stuff and then complete.

    Open your text file. Type in what you need. Put individual files on single lines with a carriage return in between. Save As and select 'All Files' and save the file name with .bat on the end:

    batfilesave.gif

    Do you want the batch files to run automatically at start up or shut down or do you want to set it off manually?
  • isofa
    isofa Posts: 6,091 Forumite
    If you are just after sync'ing files between folders/drives etc, have a look at Microsoft's free SyncToy, it's an excellent tool with many options.
  • esuhl
    esuhl Posts: 9,409 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    I have had major problems with SyncToy in which files or folders have failed to copy. FreeFileSync is much better and far more reliable from my limited experience.

    Aiadi: the batch files that are created by FreeFileSync are not the same as "normal" Windows batch files.

    You should be able to create a Windows batch file that calls the FreeFileSync batch files in turn. Just create an empty text file, rename it with a ".bat" extension and add the commands to call the !!!!!! files in turn.
  • AdrianHi
    AdrianHi Posts: 2,228 Forumite
    SyncToy (search on XP PowerToys, also available for Vista) is awesome and bullet proof. If there is ever a problem with it copying fileas it's down to a problem with file permissions or files being open in other applications.
    I've been using it for a long time to synchronise 400GB+ of media files (video, music, photos) totalling a couple of thousand files between two computers for backup purposes.
    You could probably schedule it to run at regular intervals in "Windows Scheduled Jobs", I just start it manually every week or so before going to bed and leave it running over night.
  • Aiadi
    Aiadi Posts: 1,840 Forumite
    m_13 wrote: »
    Do you want the batch files to run automatically at start up or shut down or do you want to set it off manually?
    Thanks for the detailed instructions. I actually haven't thought about starting it on shutting the computer down which sounds interesting. How does one do that then?
    Do I want it? ......Do I need it? ......What would happen if I don't buy it??????
  • Aiadi
    Aiadi Posts: 1,840 Forumite
    AdrianHi wrote: »
    SyncToy (search on XP PowerToys, also available for Vista) is awesome and bullet proof. If there is ever a problem with it copying fileas it's down to a problem with file permissions or files being open in other applications.
    I've been using it for a long time to synchronise 400GB+ of media files (video, music, photos) totalling a couple of thousand files between two computers for backup purposes.
    You could probably schedule it to run at regular intervals in "Windows Scheduled Jobs", I just start it manually every week or so before going to bed and leave it running over night.
    Thanks. I have actually tried SyncToy before and finds it quite buggy which made me lose confidence in using it to back important files up.
    Do I want it? ......Do I need it? ......What would happen if I don't buy it??????
  • GaryS
    GaryS Posts: 807 Forumite
    You might want to take a look at SyncBack (the free version).

    I use it and it is currently set to back up from my C drive to my D drive every night.

    In addition to that a weekly backup is scheduled that copies the D drive contents to a network attached drive via the wireless network.

    Never had any problems with it, and have even carried out restores to test it out.
  • AdrianHi
    AdrianHi Posts: 2,228 Forumite
    If you want to schedule you own tasks such as your batch files for execution, use windows explorer, go to C:\WINDOWS\Tasks folder, double click "Add Scheduled Task" and follow the wizard. You get to select what to run (Browse button), you can select your .bat file, specify time to run etc.
    Most windows programs can be executed from the command line, something like SyncToy.exe" -R"My folder pair name" and added to scheduled tasks like this.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 352.2K Banking & Borrowing
  • 253.6K Reduce Debt & Boost Income
  • 454.3K Spending & Discounts
  • 245.2K Work, Benefits & Business
  • 600.9K Mortgages, Homes & Bills
  • 177.5K Life & Family
  • 259.1K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.