Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a script executable in windows

Tags:

exe

How can I make a script executable in windows. just like what the chmod +x command does in linux. I have browsed but got no definite solution. Thanks for helping out.

like image 649
Wisdom Avatar asked Aug 28 '18 21:08

Wisdom


People also ask

Which command will make a script an executable file?

Use chmod to make a script an executable program.

How do you change a Windows file to an executable?

To create an executable file from the source file Open a Command Prompt window, and browse to the location of your source file. At the command prompt, type csc <source file name> , and then press ENTER.

How do I create a simple EXE file?

In the "File name" text box, type in a name followed by .exe . This will save your file as an EXE.


1 Answers

You need to give the file an executable extension. Windows executes .bat, .com and .exe files by default, but the PATHEXT environment variable determines which extensions can be executed without even writing out their extensions and in what order they will be tried.

What will be actually executed depends on the registry settings under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\, which are also edited by the "Open with..." graphical dialogs in the Explorer. For details about that, see the answer for a different question: https://stackoverflow.com/a/3924822/1584012

In your case the git-ftp script uses bash which is not pre-installed on most Windows machines. If your Windows edition supports the Windows Subsystem for Linux optional component, I suggest just installing that. But there are other options, like Cygwin, Wubi or a virtual machine.

As you wrote in your comment, Git for Windows includes an MSys2 bash shell, which is a successor of Cygwin in some sense.

like image 75
wigy Avatar answered Sep 29 '22 21:09

wigy