Run exe silently in deployment - vbscript

I'm trying to build a package and deploy it silently. I have the script ready executing an exe silently, however since the exe uninstalls a program, I still see the window "Configuring..." pop up. I am using
Set Shell = CreateObject("WScript.Shell")
Shell.Run("Uninstaller.exe 0,true)
This is working fine, as in it's running the uninstaller silently, however once the uninstaller starts doing its job, another window pops up saying "configuring application name". Is there a way to hide that?

It seems that the window you are seeing is part of the .EXE you're running.
Perhaps the "Uninstaller.exe" has a switch or parameter to make it run silently?
EDIT
If you can use a 3rd party tool, AutoIt provides an easy way to hide a window. Look at the WinSetState function.

Related

golang: optional console on windows

I am writing a service program which is expected to run in background. On Windows it will open a console window when run. I want it to go to background directly without that console window, so I used the -ldconf "-H=windowsgui" option, which worked as expected.
However, there is a catch. The program has a command line option -help, which output command line usage in the console. If I use -H=windowsgui, the help text is NOT printed even I start it in cmd.exe prompt.
It seems that the windowsgui option is not what I want. Is there anyway that the -help still works at commant line, and the console window will not persist if the program runs normally. I do not care if there is a console window pops up, provided that it disappears shortly without user intervention. i.e. I want a way on windows which is similar to the & operator on Linux.
P.S. if provided solution uses any other tools, I want that tool to be a Windows component, not any 3rd-party program. Thanks.

C:\windows\SysWow64\CScript.exe window pop up

I created a macro in Excel and i am running it from a .vbs file. It's working fine on my laptop. I copied the same work on a new laptop and each time i am running the vbs file this window appears on the screen.
I have made some research and read that the situation i mentioned is happening when loading CheckNDISPort service on the startup. But i don't believe it's the reason because when i go to task manager and check in the startUp tab i don't find this service. Also when i restart my laptop i don't get this window, only when i am running my vbs file. I am sure there is any problem with my vbs file too because on the other laptops it's working fine.
Any suggestion please how to get ride of this pop up ? For now i am closing the window each time or ending the task from task manager but everytime i run it again so it pops up again.
Thank you very much.
Windows Scripting Host has two interpreter front-ends, wscript.exe and cscript.exe. cscript.exe is a console application and if cscript.exe is set as the default a console window will open every time you execute a script.
Run cmd.exe elevated as administrator and run wscript.exe //h:wscript.
Depending on the Windows version, you might also be able to right-click a .vbs file, select "Open with...", choose %windir%\system32\wscript.exe and check the "default" checkbox.

Windows: Start exe from a batch file and handle popup dialogs started by the exe

I want to automate the installation of a component under windows 7. When I call the setup.exe from within a batch file, a dialog box opens asking me whether I really want to install the component. Since I want to automate the whole process, I need a way to automatically answer this dialog with "yes", or prevent the dialog from popping up in a way that doesn't cancel the setup.
How can I do that?

Is there any way to run a VBScript file as a screen saver?

Can you execute a VBS file as a screen saver? I have managed to rename cmd.exe to *.scr and this works, but I need to be able to run a VBS file as the screen saver if this is possible.
No, this is not possible.
In Windows, screen savers (*.scr files) are a special type of executable (.exe) file. That is why renaming a program like cmd.exe to cmd.scr causes it to sort of "work" as a screen saver. In particular, screen savers respond to certain command line switches (or parameters), which is how the OS gets them to do things like show the configuration dialog or display a preview.
But you can't compile VBScript files into executables, so there's no way to make this trick work for them.
You might be able to migrate the VBScript code to a VB 6 application, which you could then compile into an executable and run as a screen saver, but I can't imagine that this would be worth the development time. If you're interested in such a thing (and can get your hands on an old copy of VB 6!), you can probably find several how-to guides online, like this one.
But I'm honestly having a hard time imagining why one would ever want to run a VBScript script as a screen saver, or what it would display on the screen. You don't have very much control over what gets displayed on the screen, and you can't call down to native Windows API functions from VBScript. You'd end up relying upon some external library, so you might as well just use that library in the first place.
You can simply write a batch file that starts your vb script:
CD "%SystemRoot%\System32"
Start /Wait Wscript.exe "c:\program files\myscript.vbs"
Exit
Then compile the batch to exe, rename the exe to scr.

Is it possible to cancel a silent install on Windows

We have an installer wizard (written in .NET) which configures and kicks off a series of standard Windows installers. The installers are run silently. Right now, clicking "Cancel" on the wizard's dialog stops further installers from running, but does not stop whatever installer is running silently in the background.
Is there a way to send a installer running silently the equivalent of pressing the Cancel button on a non-silent install? (I could kill the installer process, but I expect that that will leave a half-installed (and probably non-uninstallable) mess behind.)
I'm not sure if you're creating new instances of these installers within your own installation wizard so I don't know how applicable this solution is going to be, but if you do have access to the actual (derived) System.Installer objects that correspond to the installers, calling the overridden System.Installer.Rollback() method of those objects should achieve the desired result. Let me know if this doesn't work and I can try helping you further.

Resources