Executing Batch files in silent mode

ririrourou -  
 amidevous -
Hello,

I am looking to execute several batch files in silent mode, meaning without the command prompt displaying. While searching the internet, I found this command:

start /min %comspec% /c NomFichier.bat

I tested it on one file, and it works perfectly well. The problem arises when I add the other files by writing commands like:

start /min %comspec% /c fichier1.bat
start /min %comspec% /c fichier2.bat
start /min %comspec% /c fichier3.bat
...

I only get the execution of a few files; it seems like it doesn't read the other commands.

Does anyone have a solution for me?

Best regards
Configuration: Windows XP Firefox 3.0.11

13 réponses

amidevous
 
The solution to your problem with the Bath to EXE Converter software
Bath to EXE Converter transforms your BAT file into an EXE and allows for silent execution if you choose the invisible application option.

You can download it here http://www.commentcamarche.net/download/telecharger-34057824-bat-to-exe-converter
7
dubcek Posted messages 18814 Registration date   Status Contributeur Last intervention   5 655
 
hello
%comspec% is the title?
what is the /c for?

and like this
start "%comspec%" /min file1.bat
start "%comspec%" /min file2.bat
start "%comspec%" /min file3.bat
0
ririrourou
 
Hello,

actually %comspec% is a variable that allows you to call cmd.exe (it's always better than writing c:\WINDOWS\System32\cmd.exe) otherwise the /c is essential.

In fact, in French:

start /min %comspec% /c fichier1.bat = open a command prompt minimized (/min) where the content of the batch 'fichier1.bat' is copied (/c)

So, does anyone have a reliable solution to make the DOS window truly invisible?

Thank you in advance for your responses

Best regards;
0
dubcek Posted messages 18814 Registration date   Status Contributeur Last intervention   5 655
 
calling cmd.exe is useless, start cmd.exe will launch cmd and will not exit

try start /min fichier.bat
0
ririrourou
 
it doesn't execute anything for me at all, the environment variable is mandatory :(
0
dubcek Posted messages 18814 Registration date   Status Contributeur Last intervention   5 655
 
Do you start your commands with a double click?
For me, start /min f.bat
starts fine
what happens if you type
start /min pause
0
ririrourou
 
but it opens the command prompt for you. That’s not what I’m looking for; I want the command prompt not to open at all. Let me explain: I want to install software in silent mode, I’m doing it through MS DOS, but I don’t like that the command prompt is displayed. I’m looking to make the MS DOS window invisible. Do you see what I mean?
0
dubcek Posted messages 18814 Registration date   Status Contributeur Last intervention   5 655
 
yes
have you tried start /b
help start
...
B Starts the application without creating a new window.
0
ririrourou
 
I already tried this option but it always opens the MS DOS window :(:(:(:(:(:(
0
dubcek Posted messages 18814 Registration date   Status Contributeur Last intervention   5 655
 
If you add
exit
at the end of the file.bat and start it with
start /min fichier.bat
it creates an icon that disappears at the end of the execution of file.bat.
0
ririrourou
 
So there is no solution to avoid displaying the DOS window? Because right now that's what I get as a result; it opens the minimized DOS window, and it indeed closes once the installation is complete, but the software I want to install takes too long, and I'm afraid that once I pass my application to someone else, they will close the DOS window before the program installation is finished, which is why I wish the window wouldn't even open. But from what I can see, my problem doesn't have a solution. :s
0
dubcek Posted messages 18814 Registration date   Status Contributeur Last intervention   5 655
 
either use VBS or Perl, or use the at command, but it must be started by specifying the time.
0
ririrourou
 
I just checked the 'at' command, but regarding the time, is it possible to tell it to start executing once the installation begins? More specifically, is there a way to make it run a specific batch when called? But thinking it over, the AT command only allows scheduling the execution of commands and programs on the computer at a specified date and time. So there will always be the issue of the window popping up. I'm starting to despair; I think there’s no answer to this problem :s. Otherwise, for Perl or VBS, I'm concerned it might not be a good idea since my project is complicated enough without adding applications in Perl or VB.

Best regards.
0
pédro
 
Hello,
I also have the same problem with the cmd prompt appearing during installation. I would like to run my script.bat in silent mode. I tried using exit and @echo off but it doesn't work; the prompt appears and then closes at the end of the installation. If anyone has an answer,
best regards.
0