# Does command interpolation work on Windows?

**URL:** <https://discourse.julialang.org/t/does-command-interpolation-work-on-windows/6139>\
**Category:** General Usage\
**Created:** [September 28, 2017, 2:35pm UTC](https://discourse.julialang.org/t/does-command-interpolation-work-on-windows/6139 "2017-09-28T14:35:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego\_Javier\_Zea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diego_javier_zea/32/1858_2.png) [@Diego\_Javier\_Zea](https://discourse.julialang.org/u/Diego_Javier_Zea)\
**Post date:** [September 28, 2017, 2:35pm UTC](https://discourse.julialang.org/t/does-command-interpolation-work-on-windows/6139/1 "2017-09-28T14:35:21Z")

</div>

I have a code that does something like:

```julia
run(̣`$julia_path $script_path`)

```

It works perfect on linux (where I’m developing), but I’m getting the following error on AppVeyor (Windows):

```julia
ERROR: LoadError: syntax: invalid escape sequence
 in include_from_node1 at .\loading.jl:488
 in process_options at .\client.jl:265
 in _start at .\client.jl:321
while loading C:\Users\appveyor\AppData\Local\Temp\1\jl_D347.tmp.jl, in expression starting on line 2
Information: Error During Test
  Got an exception of type LoadError outside of a @test
  LoadError: failed process: Process(`'C:\projects\julia\bin\julia' 'C:\Users\appveyor\AppData\Local\Temp\1\jl_D347.tmp.jl'`, ProcessExited(1)) [1]

```

I tried by changing the command a couple of times, but it looks like there is a problem in command interpolation of the `julia_path` variable on Windows (Julia 0.5). Is It possible?

AppVeyor log: [AppVeyor](https://ci.appveyor.com/project/diegozea/mitos-jl/build/1.0.430/job/5bdeor8okt8kgy37)

Best regards,

---

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [September 28, 2017, 3:35pm UTC](https://discourse.julialang.org/t/does-command-interpolation-work-on-windows/6139/2 "2017-09-28T15:35:59Z")

</div>

julia\_path is not defined on my computer

try this instead:

```julia
script_path="c:\\temp\\puth.jl"
run(`$JULIA_HOME\julia.exe $script_path`)

```

This works for me on Win 10

---

<div class="post-metadata">

**Author:** ![Diego\_Javier\_Zea](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/diego_javier_zea/32/1858_2.png) [@Diego\_Javier\_Zea](https://discourse.julialang.org/u/Diego_Javier_Zea)\
**Post date:** [September 29, 2017, 10:34am UTC](https://discourse.julialang.org/t/does-command-interpolation-work-on-windows/6139/3 "2017-09-29T10:34:06Z")

</div>

Thank @bernhard! You post help me to find the problem. I was using

```julia
juliapath = joinpath(JULIA_HOME,Base.julia_exename())

```

to define the julia path. But in windows, `julia_exename()` doesn’t add the `".exe"` extension. So, the code fails because of the missing `".exe"`. So I add the following lines to solve the problem:

```julia
if is_windows() & !endswith(juliapath,".exe")
    juliapath = juliapath * ".exe"
end

```
