Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Modify registry strings from a .BAT file (Win XP / O2003 UK SP2)

    Hi,

    Not sure this is the proper forum, but this is my best guess...

    When needed, our users activates a .BAT file that copies a number of template files from a network drive on to local PC's (enables users to work offline 'in the field' with updated templates)
    Additionally from within the .BAT file, I would like to modify some of Word's registry settings for 'Tools' - 'Options' - 'File locations' (Startup/User templates and Workgroup templates)

    Would anyone know how I achive this in the easiest possible way?
    (BAT scripting is not really among my best competencies)
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Modify registry strings from a .BAT file (Win XP / O2003 UK SP2)

    You can create a .reg file with the settings, store it in a shared network folder and install it from a batch file using the following syntax:
    <code>
    regedit /s "h:settingsoffice.reg"
    </code>
    The /s switch suppresses the dialog that regedit normally shows to ask for confirmation, and h:settingsoffice.reg must be replaced with the path and filename of the .reg file.

    The contents of the .reg file could look like this:
    <hr>Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0Common General]
    "Templates"="C:Templates"
    "SharedTemplates"=hex(2):48,00,3a,00,5c,00,44,00,6 f,00,63,00,73,00,00,00<hr>
    Note that SharedTemplates is a unicode string (this one says Hocs). The easiest way to create the .reg file is to set the paths the way you want in Word, then export the HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0Common General key from RegEdit and edit it in Notepad to remove all superfluous lines.

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Modify registry strings from a .BAT file (Win

    I don't know much about Batch files either and would normally use vbs to do this sort of thing. Perhaps this link will give you the information you are looking for www.robvanderwoude.com
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •