Running Batch File in background when windows boots up

余生长醉 提交于 2019-11-27 11:29:30
VonC

Add your program in the registry:

Run - These are the most common startup locations for programs to install auto start from. By default these keys are not executed in Safe mode. If you prefix the value of these keys with an asterisk, *, is will run in Safe Mode. Registry Keys:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run registry key
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run registry key 

Then you can launch your batch in an invisible mode:

wscript.exe "C:\yourpath\invis.vbs" "your_file.bat"

In invis.vbs put...

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

Two other startup posibilties:

  • you could always add the bat file to the startup folder,
  • or start it as a Scheduled task setting to run on logon.
Klathzazt

You can make an application run as a service.

Check this article for details:

You can use autoexnt for this. It was original designed for windows NT, but is still working in newer versions of windows.

You have to download the Windows 2003 Resource Kit to get it.

There's also hstart, a third party program that's worked well for my needs. It's maintained too. The last version was released on July 7, 2010.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!