I am trying to use a .bat that installs SQL Server 2008 Express based off of commands listed here: http://msdn.microsoft.com/en-us/library/ms144259.aspx
The problem that I have is that whether it installs successfully, or fails to install, either way it just closes the Command Prompt box with no info at all. I have to check the services list for an active instance of the install I just ran to verify if it worked or not. I added a ‘pause’ command at the end of the .bat script to at least get it to keep the command prompt window open, but it doesn’t give me any info if it errored or succeeded.
Is there a way to make it either print to a log, or print to the command prompt screen if there was an error (and if so what it was, or at which part of the install), or if it installed successfully?
You should check out errorlevels. I think SQL Server will return an errorlevel if something went wrong: http://www.robvanderwoude.com/errorlevel.php