All arguments are inside bat, so I don't need them in the field "Add arguments (optional)". 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). I created bat file with the following content: java -jar gitbucket.war ="D:\gitbucket\home" > stdout.log 2> stderr.log cmd file that will contain commands that will run on the command prompt (e.g. You will need to create two files: the first is the Powershell script (e.g. My example: I have gitbucket server that works like that. I finally got my PowerShell script to run automatically on every startup. But I don't recommend to use SYSTEM if you actually don't need such high privileges. 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. This option is available when you run your task as your current user or some another user on the machine. Some words about the option "Run whether user is logged or not". You'll have to enter your credentials when you click OK. Add an action with path to your program or bat file, put arguments and startup directory if needed. Create a task and set an option "Run whether user is logged or not". Press Win R and execute taskschd.msc there. You can use Task Scheduler to achieve this.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |