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

Author Topic: Running a batch file from a zip  (Read 13586 times)

0 Members and 1 Guest are viewing this topic.

Valarauca

    Topic Starter


    Greenhorn

    • Experience: Experienced
    • OS: Windows 7
    Running a batch file from a zip
    « on: October 23, 2012, 12:40:42 PM »
    Hello,
    I am trying to deploy a software to some remote users, I would like to be able to send them a .zip file with a .msi file as well as a .bat file. I am trying to create a self extracting zip file that will launch the batch file within it (which will then install from the msi file). The goal here is to have the user put forth as little effort as possible installing this software. Any help will be greatly appreciated.

    Thanks!

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: Running a batch file from a zip
    « Reply #1 on: October 23, 2012, 02:29:59 PM »
    " Anyone who goes to a psychiatrist should have his head examined. "

    Valarauca

      Topic Starter


      Greenhorn

      • Experience: Experienced
      • OS: Windows 7
      Re: Running a batch file from a zip
      « Reply #2 on: October 23, 2012, 02:57:55 PM »
      I can get that far, I just cant get the .bat file to launch upon extraction. Am I just simply missing something? Or is there another step that needs to be taken?

      Thanks for the response.

      patio

      • Moderator


      • Genius
      • Maud' Dib
      • Thanked: 1769
        • Yes
      • Experience: Beginner
      • OS: Windows 7
      Re: Running a batch file from a zip
      « Reply #3 on: October 23, 2012, 03:08:42 PM »
      I'm not sure...what does the .bat file do ? ?
      You can post it if you like...
      " Anyone who goes to a psychiatrist should have his head examined. "

      Salmon Trout

      • Guest
      Re: Running a batch file from a zip
      « Reply #4 on: October 23, 2012, 03:25:28 PM »
      I would like to be able to send them a .zip file with a .msi file as well as a .bat file. I am trying to create a self extracting zip file that will launch the batch file within it (which will then install from the msi file).

      Why don't you just send them the msi file?



      Valarauca

        Topic Starter


        Greenhorn

        • Experience: Experienced
        • OS: Windows 7
        Re: Running a batch file from a zip
        « Reply #5 on: October 24, 2012, 07:11:37 AM »
        Here is the .bat file I would like to run (with passwords taken out).

        @echo off

        net user administrator /active:yes
        net user administrator ******

        reg add HKLM\system\CurrentControlSet\Control\Lsa /f /v "forceguest" /t REG_DWord /d "0"

        msiexec.exe /i "Spiceworks Agent.msi" SPICEWORKS_SERVER="usdpfx1"
        SPICEWORKS_AUTH_KEY="******" SPICEWORKS_PORT=9676 SPICEWORKS_SITE_LABEL="Remote"
        ADDLOCAL=FeatureService /q /norestart /log c:\spice_agent_inst_log.txt

        @echo on

        The batch file installs the msi the way that I would like it installed, I dont really trust the remote users to correctly configure the install.

        Thanks again for the replies.

        patio

        • Moderator


        • Genius
        • Maud' Dib
        • Thanked: 1769
          • Yes
        • Experience: Beginner
        • OS: Windows 7
        Re: Running a batch file from a zip
        « Reply #6 on: October 24, 2012, 07:14:22 AM »
        Have them run the installer...then if you have remote access make the desired changes on your end...another option.
        " Anyone who goes to a psychiatrist should have his head examined. "

        TechnoGeek

        • Guest
        Re: Running a batch file from a zip
        « Reply #7 on: October 24, 2012, 07:28:47 AM »
        You can use the tool 'iexpress' (comes with windows since 2000 i believe) to create a self-extracting .exe file, containing your .bat and .msi, which extracts the files to a temporary folder and then runs the batch file.
        Start -> Run -> "iexpress" -> OK -> follow all the prompts. Add your .bat and .msi file to the 'files to extract', extract to 'temporary folder' and when done 'run specified program: myfile.bat'. I haven't used this for a while but the options should be close to that.

        Valarauca

          Topic Starter


          Greenhorn

          • Experience: Experienced
          • OS: Windows 7
          Re: Running a batch file from a zip
          « Reply #8 on: October 24, 2012, 09:51:41 AM »
          The iexpress ended up doing the trick for me. Thank you very much for the recommendation. I wasn't aware of iexpress' existence, looks like it could be a real useful tool in the future.

          TechnoGeek

          • Guest
          Re: Running a batch file from a zip
          « Reply #9 on: October 24, 2012, 10:27:04 AM »
          I wasn't aware of iexpress' existence, looks like it could be a real useful tool in the future.

          Oh, the things you find in system32... not that it's a good idea to root around in there, but still :P