Run .BAT in the background when Windows starts

-1

How can I run this BAT script in the background or invisible or without a window? I added .bat to Startup , it shows the terminal running, but I do not want to show any window, I already used conversion tool from .bat to .exe with option inivisible but did not work.

cd c:\xampp\htdocs\public_html\simrede

c:\xampp\php\php.exe -S localhost:8000
    
asked by anonymous 29.08.2018 / 18:29

2 answers

0

In my case I did the following: I created a script in .vbs with the following content and added in Startup to start at 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 execute, and saving with name inicia-PHP-xampp.bat , in the folder c: \ xampp \ htdocs \ simrede \

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

    
29.08.2018 / 20:25
1

In my case, I use a script firing it by period, and then I run with another user: Run minimized or hidden PHP script by Task Scheduler

You can do this the way I did, and use the "Log On" option to fire:

    
29.08.2018 / 18:45