Jump to content

Alternative To CMDOW?


InTheWayBoy

Recommended Posts

How can I make the CMD never appear during installations. Currently I have all my setup routines controlled by a batch file. The batch file calls CMDOW first so as to keep it from showing, but you still see the flash of the windows before it processes the CMDOW command.

I'm calling the batch file from config.txt that I am using to create a 7zip installer. As it is right now I just call my 'setup.bat' and everything works as explained. I thought maybe I could do something different like run cmdow and then feed it the batch file. It works fine in a regular command window, but when I compile and run the installer it extracts and then complains about program not found and the like...I don't have the exact message. So I tried nircmd and got similar results.

So how can this be done? I know there has to be a way to do this...if I understand it as I do, the only real way to do this would be to call the batch file from a program that hides the box, but how do I do that with a 7zip sfx? Anyone? Here's my current setup:

setup.bat

start "" /wait .\setup.exe /S

del "C:\Documents and Settings\%USERNAME%\Desktop\ABC.lnk"

config.txt

;!@Install@!UTF-8!
RunProgram="setup.bat""
;!@InstallEnd@!

build.bat

copy /b 7zs.sfx + config.txt + ABC.7z ABC.exe

so in this case I make an archive (ABC.7z) containing setup.exe and setup.bat. I then execute build.bat which does all the magic and presto it works. Now I was including cmdow.exe in the archive with an entry at the beginning of setup.bat, but of course that's where I'm not happy.

I saw on some forum about a new tools made by someone at another forum...runhiddencmd.exe or something. It sounded like just what I'm looking for, but I can't find it anymore.

I think I'm getting mixed up on the syntax for config.txt, so if you have any examples that would be nice too...thanx!

Link to comment
Share on other sites


#include <Process.au3>
$rc = _RunDos("command to run")

Use this in a autoit script and that will pass the command silently to windows :)

Compile to an exe and use in your 7z archive to be called from config.txt

But is this ABC bit torrent client? Just use /S :}

Edited by Mekrel
Link to comment
Share on other sites

I am using 2 very simple tiny wrappers by Oleg_Sch.

hidcon.exe (2kb) - runs command line apps or cmd scripts hidden. Command line is the name of the application or script and it's parameters. For example "hidcon.exe adduser.cmd username password".

msistub.exe (2.5kb) - runs msiexec.exe with specified .msi file. eq. "msistub MyApp.msi /qb!-" = "msiexec /i MyaApp.msi /qb!-".

Both programs have only one command line switch - "-nw", That means NO WAIT. By default they are waiting for lauched programs/scripts to finish.

Edited by tbma
Link to comment
Share on other sites

Well, I decided to invest some time into AutoIT and I think I'm glad I did...it's really slick, and I see a lot of uses for it.

Essentially I setup everything in "install.au3", compile it to "install.exe", which is called from "config.txt" when making the sfx...which is currently still "build.bat".

With the "install.exe" all commands are scripted, so there is now no need to hide a cmd window.

install.au3

RunWait ( @ScriptDir & "\setup.exe" )

Sleep ( 10000 )

ProcessClose ( "qttask.exe" )

FileDelete ( @AppDataDir & "\Microsoft\Internet Explorer\Quick Launch\QuickTime Player.lnk" )

FileDelete ( @DesktopCommonDir & "\QuickTime Player.lnk" )

RegDelete ( "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run", "QuickTime Task" )

config.txt

;!@Install@!UTF-8!
RunProgram="install.exe"
ExtractTitle="Preparing For Installation..."
GUIMode="1"
;!@InstallEnd@!

build.bat

copy /b 7zs.sfx + config.txt + QuickTime.7z QuickTime.exe

Of course I have customized the script to remove certain items...shortcuts, folders, startup entries, etc...in the end it runs as silent as you can get I think. There is a little systray application that runs while "install.exe" does it's thing, but that's cool, cause then I know when it's done.

Link to comment
Share on other sites

There is a little systray application that runs while "install.exe" does it's thing, but that's cool, cause then I know when it's done.
You can use the "#NoTrayIcon" command to remove the icon. It will still flash up for about 750 milliseconds (it's like a CMDOW for the tray icon ;) ). "Opt("TrayIconHide", 0)" will bring it back.
Link to comment
Share on other sites

  • 1 year later...
I am using 2 very simple tiny wrappers by Oleg_Sch.

hidcon.exe (2kb) - runs command line apps or cmd scripts hidden. Command line is the name of the application or script and it's parameters. For example "hidcon.exe adduser.cmd username password".

msistub.exe (2.5kb) - runs msiexec.exe with specified .msi file. eq. "msistub MyApp.msi /qb!-" = "msiexec /i MyaApp.msi /qb!-".

Both programs have only one command line switch - "-nw", That means NO WAIT. By default they are waiting for lauched programs/scripts to finish.

works like a charm! I like the hidcon.exe

Link to comment
Share on other sites

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...