Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Writing Batch File  (Read 3779 times)

0 Members and 1 Guest are viewing this topic.

jq_green

    Topic Starter


    Newbie

    Writing Batch File
    « on: February 24, 2009, 10:05:25 AM »
    Hello Everyone,
            I am currently just learning how to write batch files. I currently am working on a Windows XP machine, w/SP2 and a Pentium R dual Processor.

    I would like to write a batch file For Word Excel and Powerpoint that changes the default save location of My Documents to a folder on the root of C: called "Office Documents".  I'd like it to be in the registry settings. I know that it has to be done in notepad but where do I start??? HELP!! :-\  :-\  :-\

    DaveLembke



      Sage
    • Thanked: 662
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Writing Batch File
    « Reply #1 on: February 24, 2009, 03:06:34 PM »
    If this is for just one computer, I would go to the options for the word, excel, etc and specify the default save location. Batches are intended for repetitious uses like a fleet of 60 laptops that you want all the same etc. On a single system it can be done in batch but far easier to just use the GUI drop down interface in  MS Office Apps to specify the default save location as where you want it to be.

    Such as in Office 2000 Word has this feature in Tools --> Options --> File Locations --> select documents highlighted --> select modify--> then specify the path such as C:\OfficeDocuments

    and Excel 2000 has it in Tools-->Options-->General--> put path of C:\OfficeDocuments in the Default file location field.

    and Powerpoint 2000 has it in Tools-->Options-->Save--> then place C:\OfficeDocuments in the default file location field and select OK.


    This all could be handled through a batch, but WARNING it will write to your registry and if it malfunctions it could crash windows. Using the built in user interface to specify for this single computer need would be far safer for anyone new to batch.

    Before learning how to edit registry keys with a batch, I would first gain a grasp of batch programming...start with the basics of the ECHO OFF and ECHO ON and @echo. Hello World and start playing with setting variables and passing values and writing to files and manipluating data through statements that test for conditions and if this do that etc. Then once you master this, then dig into the heart of Windows environment variable editing through scripts.

    jq_green

      Topic Starter


      Newbie

      Re: Writing Batch File
      « Reply #2 on: February 25, 2009, 05:00:19 AM »
      Understood. Good Advice and I'm going to start doing that but this is for multiple machines, and somthing that I probably will be doing on a regular basis now. I know that you write the file in a notebook window and when you save it you do so with a .bat extention, but as to where to start or how to start I dont have a clue. HELP PLEASE!!!