# How to make clickable julia script for Windows

**URL:** <https://discourse.julialang.org/t/how-to-make-clickable-julia-script-for-windows/8618>\
**Category:** General Usage\
**Tags:** question, windows\
**Created:** [January 26, 2018, 4:23pm UTC](https://discourse.julialang.org/t/how-to-make-clickable-julia-script-for-windows/8618 "2018-01-26T16:23:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![favba](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/favba/32/2735_2.png) [@favba](https://discourse.julialang.org/u/favba)\
**Post date:** [January 26, 2018, 4:23pm UTC](https://discourse.julialang.org/t/how-to-make-clickable-julia-script-for-windows/8618/1 "2018-01-26T16:23:42Z")

</div>

This questions is more a windows question than a Julia one, so, I’m sorry if this is out of place.

### Background

I’m taking a Computational Fluid Dynamics class, where we will be building a cfd code along the semester, and I convinced the professor to allow me to use Julia, although he doesn’t know the language.  
Basically, as homework, every week I have to send small executables of part of the code, for example a routine that reads in neutral files and outputs vtk’s. And he will test it.  
The problem is he uses Windows, and I haven’t touch a non-Unix machine for ages.  
Originally he asked for us to send .exe files, but I don’t want to go to the hassle of compiling and building an executable. He will install julia on his laptop so he can run my scripts. So, finally my question:

**TL;DR** : Is there a way to make an “executable” julia script for Windows? Something like putting the `#!/usr/bin/env julia` in Unix machines.

---

<div class="post-metadata">

**Author:** ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)\
**Post date:** [January 26, 2018, 6:13pm UTC](https://discourse.julialang.org/t/how-to-make-clickable-julia-script-for-windows/8618/2 "2018-01-26T18:13:08Z")

</div>

[Batch file - Wikipedia](https://en.wikipedia.org/wiki/Batch_file) ?

---

<div class="post-metadata">

**Author:** ![John\_Hearns](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/john_hearns/32/1685_2.png) [@John\_Hearns](https://discourse.julialang.org/u/John_Hearns)\
**Post date:** [January 26, 2018, 7:28pm UTC](https://discourse.julialang.org/t/how-to-make-clickable-julia-script-for-windows/8618/3 "2018-01-26T19:28:45Z")

</div>

Favba, I have a Windows 10 laptop with Julia 0.6.2 installed.  
I can test run your submissions if it helps.

---

<div class="post-metadata">

**Author:** ![John\_Hearns](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/john_hearns/32/1685_2.png) [@John\_Hearns](https://discourse.julialang.org/u/John_Hearns)\
**Post date:** [January 26, 2018, 7:29pm UTC](https://discourse.julialang.org/t/how-to-make-clickable-julia-script-for-windows/8618/4 "2018-01-26T19:29:59Z")

</div>

Actually a better answer would be for you to prepare a Juyputer notebook,  
and for your tutor to use that. Perhaps on a Juliabox account.

---

<div class="post-metadata">

**Author:** ![favba](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/favba/32/2735_2.png) [@favba](https://discourse.julialang.org/u/favba)\
**Post date:** [January 26, 2018, 11:27pm UTC](https://discourse.julialang.org/t/how-to-make-clickable-julia-script-for-windows/8618/5 "2018-01-26T23:27:58Z")

</div>

I borrowed a Windows laptop from a friend and managed to do it.

**First option** : A Batch file, as @Liso suggested:

```julia
start C:\User\UserName\AppData\Local\Julia-0.6.2\bin\julia myscript.jl
end

```

But then I need to know the path to the julia executable beforehand.

**A second option** I discovered was, by clicking in a .jl file, Windows asks me for a program to open .jl files. I just set it to julia, and now I get exactly what I wanted: a clickable julia script.

* * *

Thanks for the suggestions, @John_Hearns! But I wanted to make this the least disruptive of the way he wanted(sending by email an executable) as possible. I’ll just send him a .jl file, ask him to set Julia as the program to open with, then every other .jl script I’ll send him will just work.

---

<div class="post-metadata">

**Author:** ![Liso](https://avatars.discourse-cdn.com/v4/letter/l/898d66/32.png) [@Liso](https://discourse.julialang.org/u/Liso)\
**Post date:** [January 27, 2018, 8:57am UTC](https://discourse.julialang.org/t/how-to-make-clickable-julia-script-for-windows/8618/6 "2018-01-27T08:57:52Z")

</div>

Do you need to work with parameters (list of input and output files for example)?

---

<div class="post-metadata">

**Author:** ![favba](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/favba/32/2735_2.png) [@favba](https://discourse.julialang.org/u/favba)\
**Post date:** [January 27, 2018, 7:00pm UTC](https://discourse.julialang.org/t/how-to-make-clickable-julia-script-for-windows/8618/7 "2018-01-27T19:00:32Z")

</div>

Not now, but I might eventually. In order to my second option to work, I guess I’ll have to write a script that prompts for the input, something like:

```julia
#myscript.jl

function main(input::String,output::String)
 do_stuff...
end

print("Please provide input file name: ")
const input = readline()
print("Please, provide output file name: ")
const output = readline()

main(input,output)
```

---

<div class="post-metadata">

**Author:** ![PaulJaval](https://avatars.discourse-cdn.com/v4/letter/p/bcef8e/32.png) [@PaulJaval](https://discourse.julialang.org/u/PaulJaval)\
**Post date:** [October 13, 2019, 2:03pm UTC](https://discourse.julialang.org/t/how-to-make-clickable-julia-script-for-windows/8618/8 "2019-10-13T14:03:21Z")

</div>

Hi favba, I am experiencing the same: a solution with limited effort is to install git-bash on windows. Then, if you start your .jl file on your end with " #!/usr/bin/env julia ", you can execute on the windows end the .jl file with the usual command ./my\_file.jl in git-bash
