Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 226
Irrech Avatar asked Jun 16 '26 03:06

Irrech


1 Answers

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

like image 127
statosdotcom Avatar answered Jun 17 '26 23:06

statosdotcom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!