简体   繁体   中英

How to run git bash scripts on windows startup

I've created a shell script and for execute it I need to use GIT BASH with this command

sh scriptname.sh

It's possible execute this command on GIT BASH when windows startup automatically?

In Windows 10:

1) Create a regular, plain text file named myscript.txt , for example.

2) As its contents, insert this: sh scriptname.sh . Save and close.

3) Rename this file to myscript.bat then, with your Windows Explorer, locate the file at the filesystem folder, right click on it and select " copy ".

4) Yet on Windows Explorer, go to <ROOT>\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp and right click on it. Then select " paste shortcut " (you will need Administration rights to do it).

It's done. Every time your windows starts it runs your bash.

More info: https://support.microsoft.com/en-us/help/4026268/windows-10-change-startup-apps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM