Run . BAT in the background on Windows startup

Asked

Viewed 5,048 times

0

How can I run this BAT script in the background or invisible or without window? I added .bat in Startup, it shows the terminal running, but I don’t want to show any window, I’ve used conversion tool .bat for .exewith no visible option but did not work.

cd c:\xampp\htdocs\public_html\simrede

c:\xampp\php\php.exe -S localhost:8000
  • It is a script to run by scheduling, where?

  • @Rbz I want it to start along with the system, it already starts, but I do not want it to be viewed window running, understand?

  • It starts with the system how? Where? Detail to the maximum, because the form that calls your . bat is fundamental to know!

  • @I put it in the folder Startup, so when I log in it starts, but keeps showing the terminal window, and I don’t want it to be shown window

  • START /B command string.bat

  • @Danielomine, it didn’t work

  • Depending on the resources and environment, a solution may or may not work. As there are many variants, look for these terms "run bat file in background" in google.

  • I wonder what it takes for a being to deny a clear question like that

  • 1

    Take a look here https://www.thewindowsclub.com/run-batch-files-silently-on-windows

  • Hello @Leandroangelo already solved, my answer is below. Thank you

  • Then mark it as such... not to leave this question open

  • I can only mark my own response after two days of publication.

Show 7 more comments

2 answers

1


In my case I did the following: I created a script in .vbs with the following content and add in Startup to start on logon:

set objSh = CreateObject("WScript.Shell")
objSh.Run "cmd /k c:\xampp\htdocs\simrede\inicia-PHP-xampp.bat", 0

I created another script with the commands I want to be executed, and saving with name inicia-PHP-xampp.bat, in folder c: xampp htdocs simrede\

So the script inicia-PHP-xampp.bat starts in the background.

1

  • This option does not serve as the user would have to configure on his machine, as it is to implement in an installer is not interesting

  • I thought it was something for a server, so I gave it a more practical alternative. But in this case, the best way would be to convert, as in Laércio’s reply.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.