Microsoft
Software
Hardware
Network
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\msie
xec.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.c
om/kb/3148
81/EN-US/
http://msdn2.microsoft.com
/en-us/lib
rary/aa367
988.aspx
I would do the same with the Regedit command, eg:
start /wait %SystemRoot%\system32\rege
dit.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.m
de
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/gsf
x/index.as
px
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/compute
rs2/Articl
es/inf-fil
e.htm
http://msdn2.microsoft.com
/en-us/lib
rary/aa741
215.aspx
http://msdn2.microsoft.com
/en-us/lib
rary/ms790
220.aspx
http://www.msfn.org/board/
install_in
f_file_com
mand_line_
t104891.ht
ml
http://www.dx21.com/SCRIPT
ING/RUNDLL
32/INF.ASP
http://www.osronline.com/d
dkx/instal
l/create-i
nf_4l47.ht
m
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/i
ndex.htm
There are a lot of these type of programs about, and some are freeware:
http://www.tucows.com/soft
ware.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.
Random Solutions
Antivirus solution for Windows Server 2008 R2 Core.
How to zip/unzip with VB.NET?
Export Worksheets with Values and additional Code for Cell Protection
SQL criteria applied to nested queries
Using Rich Text Box
Disappearing Appointments in Exchange 2007, Outlook 2007 mailboxes
SharePoint Services Site Image
programmatically work with object data source and report viewer
InfoPath 2007: Error on file open, "InfoPath cannot create a new, blank form"
How do I use a user-defined function in Access