xarumanx Posted August 2, 2003 Share Posted August 2, 2003 Doesn anyone know how to log the contents of the whole cmd-window while executing the .cmd file(s)?So for example writing an install.log file where all error messages are sotred so you don't have to watch your computer while installing everything. Link to comment Share on other sites More sharing options...
devil270975 Posted August 13, 2003 Share Posted August 13, 2003 Yes I would also like to know this, Anyone??????? Link to comment Share on other sites More sharing options...
quya Posted August 13, 2003 Share Posted August 13, 2003 It's easy.install.cmd >install.log Link to comment Share on other sites More sharing options...
Aaron Posted August 13, 2003 Share Posted August 13, 2003 This is the only command I know of, and because of the way it works, you may have to define multiple filenames for each start/copy/del process you perform. (to prevent overwriting). The > C:\file.txt works on any DOS command, as long as its on the end of the command, examples:start /wait blahblah\apps\zonealarm.exe /qn > c:\zonealarm.txtdel %systemrooot%\system32\uxtheme.dll > c:\uxtheme.txtand so on. Let me know how it goes. Link to comment Share on other sites More sharing options...
Aaron Posted August 13, 2003 Share Posted August 13, 2003 It's easy.install.cmd >install.logActually use this one, much better. Link to comment Share on other sites More sharing options...
devil270975 Posted August 13, 2003 Share Posted August 13, 2003 when i tried user.cmd >"c:\setup.log" it kept on looping my code, why, and wherte in the batch do i put >blah blah Link to comment Share on other sites More sharing options...
Aaron Posted August 13, 2003 Share Posted August 13, 2003 when i tried user.cmd >"c:\setup.log" it kept on looping my code, why, and wherte in the batch do i put >blah blahthere must be a space inbetween > and C:\You won't need the quotes if you specify a filename without spaces.examples:user.cmd > "c:\setup logs.log"user.cmd > c:\setup.log Link to comment Share on other sites More sharing options...
devil270975 Posted August 13, 2003 Share Posted August 13, 2003 still loops through the code ie: keeps repeating the cmd scriptany chance of some example code that you have tested???? Link to comment Share on other sites More sharing options...
Travelcard Posted August 13, 2003 Share Posted August 13, 2003 If you use >> it will append to the file. > overwrites. That way you can have one log for all of your batches i.e.main_batch.cmd >> c:\batches.txtHotfixes.cmd >> c:\batches.txtApplications.cmd >> c:\batches.txt Link to comment Share on other sites More sharing options...
devil270975 Posted August 13, 2003 Share Posted August 13, 2003 whenever i put main.cmd > c:\main.log it keeps calling itself why???? Link to comment Share on other sites More sharing options...
Travelcard Posted August 13, 2003 Share Posted August 13, 2003 EDIT...The code below does NOT work.I have no idea why because if you ran it from a command prompt there would be no problems.Putting it in the winnt.sif gives an error and stops the installation from running.It seems as though normal cmd prompt options will not work with the winnt.sifAnyone have any ideas about this?Hmmm, what do you mean 'keeps calling itself'?It sounds like you've put the main.cmd > c:\main.log line in the batch file - is that right? if so that's your error, you should place that in your winnt.sif i.e.I haven't actually tried this yet but I think you should do this. I am going to try it myself right now and will report back in a couple of hours with my results.Replace:[GuiRunOnce] %systemdrive%\software\main_batch.cmd %systemdrive%\software\hotfixes.cmd %systemdrive%\software\applications.cmdWith[GuiRunOnce] %systemdrive%\software\main_batch.cmd >> %systemdrive%\batches.txt %systemdrive%\software\hotfixes.cmd >> %systemdrive%\batches.txt %systemdrive%\software\applications.cmd >> %systemdrive%\batches.txtIt might also be worth removing @echo off just so you get more info. Link to comment Share on other sites More sharing options...
Travelcard Posted August 13, 2003 Share Posted August 13, 2003 It's easy.install.cmd >install.logHave you actually got this to work and if so where did you put this command? Link to comment Share on other sites More sharing options...
Aaron Posted August 13, 2003 Share Posted August 13, 2003 It might work if you have one batch file that calls out to your other batch files Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now