1

Can I run a program on start-up before anyone has logged in? So that, for example, q-torrent and some other programs start again after unexpected shutdown (like power failure or similar) and automatically do their tasks. And also would the following program be seen in task manager like is running by system or user.

2 Answers 2

1

You can launch your app as service . Services are app which the windows start from the startup even before log in screen comes .

You can follow this tutorial to do so

1
  • 1
    @Davidenko Are you wanting to run a torrent program, or is that the first example you thought of? If you are wanting to run a torrent program there are clients that will run as a service natively instead of hacking it to do something it was not meant to do and works exactly like you want to (runs before login but you still get a UI once you log in) Apr 4, 2013 at 22:59
2

You can use Task Scheduler to achieve this. Press Win+R and execute taskschd.msc there. Create a task and set an option "Run whether user is logged or not". Create a trigger "At startup". Add an action with path to your program or bat file, put arguments and startup directory if needed. You'll have to enter your credentials when you click OK.

Some words about the option "Run whether user is logged or not". This option is available when you run your task as your current user or some another user on the machine. But you can specify to run the task as SYSTEM to grant maximum privileges and "Run whether user is logged or not" will be disabled because SYSTEM is always online. But I don't recommend to use SYSTEM if you actually don't need such high privileges.

My example: I have gitbucket server that works like that. I created bat file with the following content:

java -jar gitbucket.war --gitbucket.home="D:\gitbucket\home" > stdout.log 2> stderr.log

So, I put path of the bat file in the field "Program/script" (D:\gitbucket\gitbucket.bat) and its directory in the field "Start in (optional)" (D:\gitbucket). All arguments are inside bat, so I don't need them in the field "Add arguments (optional)".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .