seapagan Posted January 18, 2006 Posted January 18, 2006 (edited) Hey,I knocked together a quick program a few days ago, and posting it here in case anyone else would find it useful.What it basically does is to enable you to run any batchfile (without modification) but have nothing appear on the screen, ie no CMD window will be visible.I use this for creating my silent application installs, it removes the need to use 'cmdow' or similar. Many silent installers run using batchfiles to install the app, add registry entries, copy extra files etc, and this usually means having a CMD window visible on the screen, or using cmdow to hide it (which still flashes briefly). Otherwise, if you use a batch compiler you run the risk that it wont work properly on other peoples machines.Usage is simple :Just replace the part of your silent (7z or rar) installer that normally calls <batchfile> with :batchrunner <batchfile>There is also one command line option - /s - which will hide any errors that may occur so that if you are using this from runonceex your installation wil not pause to wait for you to press ok. Eg:batchrunner install.cmd /sOne final thing, the batchfile name is optional - if one is not specified it will try to run 'install.cmd'. It always looks for the specified batch in the same directory as it is located, so works ok for silent installers when the archive is extracted to a temp directory. I have tried this with several of my own silent installers, from RunOnceEx & SVCPACK, and it works perfectly The program will wait until the batch has completed before exiting, so works well from RunOnceEx. Program is totally standalone, just copy the .exe file into the same folder as the rest of the files for your silent installer before you archive the lot up.I would recommend not using the /s switch until you are 100% sure that your installer works - just so you can see any error messages. Likewise, make sure your batch file is working properly before using batchrunner! You will see no console window to aid troubleshooting.Please let me know how it works for you, any errors, and any suggestions for improvements.SPBatchRunner.7z Edited January 22, 2006 by seapagan
smashly Posted January 18, 2006 Posted January 18, 2006 Thank You for sharing, will have a play with it when I get home from work tonight. Cheers.
ivwolferen Posted January 18, 2006 Posted January 18, 2006 (edited) Way to go This has the advantage not having to edit your bat files(like you do with cmdow)Can this also be used on COM files?thnx for sharing.... Edited January 18, 2006 by ivwolferen
seapagan Posted January 18, 2006 Author Posted January 18, 2006 Way to go This has the advantage not having to edit your bat files(like you do with cmdow)Can this also be used on COM files?thnx for sharing....Thanks At the moment this cannot be used on com files, because I deliberately restricted it to only bat or cmd in the code (try it, it will tell you its not a batch file).There is no reason why the code should not work for com files though (even exe files I guess). I'll take a look later and try. As long as the com (or console exe) requires no user input I dont see a problem with it working.SP
seapagan Posted January 18, 2006 Author Posted January 18, 2006 Update: I have just completed a full reinstall of XP on one of my machines, using this tool in a few silent installers run from SVCPACK and RunOnceEx with no problems. It also works from cmdlines.txt SP
Bilou_Gateux Posted January 18, 2006 Posted January 18, 2006 (edited) alternative to cmdow @ /HIDI do not want to discourage you from writing useful tools, but:nircmd.exe is only 24 Kb and can do more.but i will try it for this feature:One final thing, the batchfile name is optional - if one is not specified it will try to run 'install.cmd'. It always looks for the specified batch in the same directory as it is located, so works ok for silent installers when the archive is extracted to a temp directory. I have tried this with several of my own silent installers and it works perfectly Edited January 18, 2006 by Bilou_Gateux
seapagan Posted January 18, 2006 Author Posted January 18, 2006 alternative to cmdow @ /HIDI do not want to discourage you from writing useful tools, but:nircmd.exe is only 24 Kb and can do more.True, but if I bothered to run upx on it, it comes out at 21Kb nircmd is a good tool, but I wanted something quick, simple and without a plethora of command lines. Only took me about 20mins to write so I didn't waste my life on it! Maybe I'll rewrite it in asm, see how small I can get it Thanks for the feedbackSP
InTheWayBoy Posted January 18, 2006 Posted January 18, 2006 Great...another util worth it's weight in...KB? LOLVery useful, even if there are other options...it's nice to have one program do one thing and nothing more. I have moved from bat/cmd installs to AutoIT specifically because of this issue...but now I might switch back. I'll grab this and hang on to it for now, keep up the good work!
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