1. Welcome! Please take a few seconds to create your free account to post threads, make some friends, remove a few ads while surfing and much more. ClutchFans has been bringing fans together to talk Houston Sports since 1996. Join us!

Geek Help- Writing a Batch File

Discussion in 'BBS Hangout' started by Xerobull, Apr 29, 2010.

  1. Xerobull

    Xerobull ...and I'm all out of bubblegum

    Joined:
    Jun 18, 2003
    Messages:
    37,219
    Likes Received:
    36,188
    It's been a looong time for me, and back in the day when we needed batch files, I had a boss who did most of the batch stuff, so I was never very practiced.

    Very simple: I need a sample batch that will install a .exe and then run a .reg to change several registry settings.

    Can someone post an example?

    Much thanks.
     
  2. digitalbreach

    digitalbreach Member

    Joined:
    Oct 28, 2008
    Messages:
    713
    Likes Received:
    27
    never had to execute a .reg file but the following should work for .exe


    copy and paste below into .bat file (via notepad or notepad++)



    cd c:\program files\mozilla
    firefox.exe
    exit
     
  3. boomboom

    boomboom I GOT '99 PROBLEMS

    Joined:
    Sep 29, 1999
    Messages:
    12,789
    Likes Received:
    9,470
    Is your .exe the installer? There's probably documentation for running the .reg stuff from the command line.

    If the .exe is the installer...check the installer documentation for command line arguments...as you'll probably want to run it in silent mode. Same thing with the .reg stuff.

    Just an offshoot guess...

    bat file would look something like this (assuming the .exe is the installer)...

    installer.exe /S
    registry.reg /S

    with /S's being the silent install arguments. Otherwise, the installer and registry installer will probably throw up message prompts and pause while waiting for input.
     
    1 person likes this.
  4. digitalbreach

    digitalbreach Member

    Joined:
    Oct 28, 2008
    Messages:
    713
    Likes Received:
    27
    1 person likes this.
  5. Master Baiter

    Master Baiter Member

    Joined:
    Jul 6, 2001
    Messages:
    9,608
    Likes Received:
    1,376
    How are you deploying this? Hard coding stuff sucks.
     
    1 person likes this.
  6. Xerobull

    Xerobull ...and I'm all out of bubblegum

    Joined:
    Jun 18, 2003
    Messages:
    37,219
    Likes Received:
    36,188
    Thanks for the help.

    I'm building an install package and sending it out to a bunch of techs. Based on experience, I need to assume they're all idiots.

    I'm going to put one folder on a USB drive. They will then copy the USB drive to the root of their PCs. The folder will contain the setup.exe and the regkey.reg. They will then run the batch file from within the folder. Trying to make it as foolproof as possible.
     
  7. SwoLy-D

    SwoLy-D Member

    Joined:
    Jul 20, 2001
    Messages:
    37,618
    Likes Received:
    1,456
    1. Build a top-down scheme of how you want the BAT file to run.
    2. Create it.
    3. Test it.
    4. Test it.
    5. Test it on someone else's machine.
    6. Make your final corrections.
    7. Document it and write everything down.
    8. Send it and ask for lots of feedback.
    Nice attitude. This will get you FAR in life, sir. :rolleyes:

    :cool: Man, stop thinking like that. You're only hurting yourself. :( I am serious. Don't ever let anyone outside 'the family' know what you're thinking (much less if you're calling them "idiots"). Won't help you much.
     
  8. Xerobull

    Xerobull ...and I'm all out of bubblegum

    Joined:
    Jun 18, 2003
    Messages:
    37,219
    Likes Received:
    36,188
    Steps 1-7 are a given.

    Step 8 and the subsequent commentary...It's been my experience with this group of people that you have to assume that they know nothing. They are government employees.
     

Share This Page