.bat in the background

Solved
kimojo Posted messages 402 Status Membre -  
 dca -
Hello,
I created a .bat that does some things :)
Then I created a scheduled task that runs this .bat every 2 minutes. Indeed, I need this .bat to be executed every 2 minutes.
However, every 2 minutes, a DOS window opens and closes in less than 1 second, which is quite unpleasant.

I would like to know if it is possible for this .bat to never show up.

Thank you
Configuration: Windows XP Firefox 3.0.6

14 réponses

BeFaX Posted messages 16334 Status Contributeur 3 864
 
Under Windows XP, I found this, which hides the launched windows:

It's VBS, you need to save it in a file with the .VBS extension, then you can run it like an application. Replace what is underlined with your BAT file and place it in the same folder; otherwise, it seems to work by specifying an entire directory.

Dim shell, command
Set shell = WScript.CreateObject("WScript.Shell")
command="fstexe.exe"
shell.Run command, 0,true
WScript.quit
5
mercedes
 
Hello,

if I want to run several .bat files in the background one after another, essentially chaining them, do I just need to declare other variables like command and shell?
0
qqn
 
thank you
0
dca
 
Thank you very much for this tip, exactly what I needed to launch PHP on an HTTP server at startup.
0
Anonymous user
 
You need to use cmdow, check this link
http://ww1.win-web.be
--
People who say that Windows is shit and continue to use it make me laugh...
95% of errors come from what is between the keyboard and the chair.
0
Profile blocked
 
Hello, create a shortcut in the same directory as the batch file, then go to the properties of the shortcut and in the Run option choose Minimized mode and confirm... reschedule the task using the new shortcut... from now on the window will no longer be visible except in the taskbar.
0
kimojo Posted messages 402 Status Membre 41
 
Thank you

I tested the Vbscript, it works perfectly just one question:
What is the purpose of the line: Dim shell, command
Whether it is present or not, the script works.

As for the shortcut, it doesn't work properly. Indeed, when I create my task and specify the shortcut, at the moment I browse and then click ok it agrees but when I look at the chosen path, it takes the script and not the shortcut.

Thank you

Thanks also to Dante even though I prefer the other solutions where I don't have to install anything.
0
BeFaX Posted messages 16334 Status Contributeur 3 864
 
I think that the line Dim shell, command is used to "declare the variables".
0
dubcek Posted messages 18702 Registration date   Status Contributeur Last intervention   5 656
 
you start your .bat or your command with start /b
0
kimojo Posted messages 402 Status Membre 41
 
By using start /b, the console stays open all the time :)
0
dubcek Posted messages 18702 Registration date   Status Contributeur Last intervention   5 656
 
What does that mean?

Starts a new window to run the given program or command.
START ["title"] path [/I] [/MIN] [/MAX] [SEPARATE]
| /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL
[/WAIT] [/B] [command/program]
...
B Starts the application without creating a new window.
0
kimojo Posted messages 402 Status Membre 41
 
I have my .bat on my desktop.
If I put start /b at the beginning of the file and execute it, the window stays open.

In my opinion, this command allows not to open a new window but keeps the current one open.
0
dubcek Posted messages 18702 Registration date   Status Contributeur Last intervention   5 656
 
il faut faire start /b command
0
kimojo Posted messages 402 Status Membre 41
 
No, still not.

Did you try it and does it work for you?

Like, create a .bat file on your desktop for example and put this in it:
start /b cd C:\Documents and Settings\

When you double-click on your .bat file on the desktop, doesn't the window open?

For me, this command is just meant to prevent a new window from opening when executing the command but keeps the current one open.
0
Profile blocked
 
Send me your email and I'll send you a tool that can solve the problem right away ;)
0
kimojo Posted messages 402 Status Membre 41
 
Thank you, but it's for putting on a server later, so I don't really want to add more programs. The VBS is working very well, so I think I'll stick with that.

But thank you for suggesting :)
0
i
 
Hello, try to create your .bat file and save it on the desktop as a vbs file. I don't think it will restart itself. Send your reply, see you++
0