|
Question : I have a batch file I would like to make more Professional.
|
|
Below is my batch file I would love to get in EXE or COM. I've tried many bat2exe or com programs but they all mess up the batch program or ignore echo. command (for space) and I believe all of them ignore the pause command completely.... I've also tried IEXPRESS that I found on XP.. that would be great.. but also didn't wait for user to press enter... and can't get it to do what I need.
Any suggestions?
Here is my batch
echo off cls title Big Stick Installation echo. echo. echo. echo. echo Installing.... echo. echo. md c:\BigStick md c:\BigStick\Backup copy fix.bat c:\BigStick copy BigStick.mde c:\BigStick\Backup copy BigStick.ico c:\BigStick copy BigStick.mde "C:\Documents and Settings\All Users\Desktop\BigStick.mde" cls echo. echo. echo. echo. echo. echo. echo. echo. echo Please refer to the Installation Manual to help guide you through this step. echo. echo. echo. echo. echo. pause echo.
ACCESSRT.MSI cls echo. echo. echo. echo. echo. echo. echo. echo. echo. pause regedit.exe /s urs.reg cls echo. echo. echo. echo You will now start your printer install, echo PLEASE FOLLOW THE PRINTER INSTRUCTIONS IN THE MANUAL.(Steps 1-3) echo. echo. echo. echo. echo. echo. echo. echo. echo. echo. echo. echo. echo. echo When Windows has finished installing the drivers, you will be echo returned to this window at which time you will press any key to continue. echo. echo. Pause cls echo. echo. echo. echo. echo Rebooting your computer. This may take up to 2 min. PLEASE DONT PRESS ANY KEY. echo. echo. sd.exe -r -t 01 -f pause echo on
|
|
Answer : I have a batch file I would like to make more Professional.
|
|
There's a couple of parts that you should maybe change in the batch file regardless of what you intend to do with it.
The command to call ACCESSRT.MSI is done without specifying any parameters. A better way would be to call the program that is set to run the *.msi file type, and halt the batch process until it finishes by prefixing the command with START /wait, like this:
start /wait %SystemRoot%\system32\msiexec.exe /i %~dp0\accessrt.msi
In Windows XP, the %~dp0 variable holds the directory that the batch file was started from. Msiexec.exe (The Windows Installer Tool) supports a number of switches by which you can dictate how it is run, including a forced reboot or a reboot only if required:
http://support.microsoft.com/kb/314881/EN-US/ http://msdn2.microsoft.com/en-us/library/aa367988.aspx
I would do the same with the Regedit command, eg:
start /wait %SystemRoot%\system32\regedit.exe /s %~dp0\urs.reg
That assumes "urs.reg" is in the same directory as the batch file, and not in C:\Windows\System32 folder along with regedit.exe, which would be the more usual scenario.
As an alternative to the Start /wait prefix, you can CALL a program. This passes control out of the batch file to it, and when done control is returned back to the batch file. The CALL prefix command is normally used to call other batch files.
You can also use the Windows XP variable %ALLUSERSPROFILE% instead of quoting C:\Documents and Settings\All Users, eg:
copy BigStick.mde %ALLUSERSPROFILE%\Desktop\BigStick.mde
There are a number of freeware and shareware programs that make it quite easy to compile your own customised installer where you can create your own info screens and prompts.
Probably the simplest method would be to build a self-extracting executable file (SFX package) that can be told to run a setup routine after it unpacks, like this: http://www.gdgsoft.com/gsfx/index.aspx
You can do this in a more basic way using WinRAR to create a self-extracting *.exe file, but it's not as professional.
I've used this more advanced application from the same vendor, but you pay for the full version: http://www.gdgsoft.com/pb/index.aspx
Creating, modifying, or deleting registry keys and values, copying files, etc, can also be done with *.INF files, and you can use IExpress to package them:
http://vlaurie.com/computers2/Articles/inf-file.htm http://msdn2.microsoft.com/en-us/library/aa741215.aspx http://msdn2.microsoft.com/en-us/library/ms790220.aspx http://www.msfn.org/board/install_inf_file_command_line_t104891.html http://www.dx21.com/SCRIPTING/RUNDLL32/INF.ASP http://www.osronline.com/ddkx/install/create-inf_4l47.htm
Driver CD creators tend to use design programs like this to create CD Autorun interfaces from which Readme files can be launched and where the user can click on the appropriate button to install something or exit: http://www.cdmenupro.com/index.htm There are a lot of these type of programs about, and some are freeware: http://www.tucows.com/software.html?t=706 I used to use AutoPlay Menu Studio, which was the previous version of the fully featured retail application: http://www.indigorose.com/ams/
Hope this helps.
|
|
|
|