Computer Hope

Software => Computer software => Topic started by: Valarauca on October 23, 2012, 12:40:42 PM

Title: Running a batch file from a zip
Post by: Valarauca 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!
Title: Re: Running a batch file from a zip
Post by: patio on October 23, 2012, 02:29:59 PM
7-Zip Tutorial... (http://www.wikihow.com/Use-7Zip-to-Create-Self-Extracting-excutables)
Title: Re: Running a batch file from a zip
Post by: Valarauca 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.
Title: Re: Running a batch file from a zip
Post by: patio 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...
Title: Re: Running a batch file from a zip
Post by: Salmon Trout 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?


Title: Re: Running a batch file from a zip
Post by: Valarauca 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.
Title: Re: Running a batch file from a zip
Post by: patio 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.
Title: Re: Running a batch file from a zip
Post by: TechnoGeek 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.
Title: Re: Running a batch file from a zip
Post by: Valarauca 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.
Title: Re: Running a batch file from a zip
Post by: TechnoGeek 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