# Run(\`start\`) doesn't work

**URL:** <https://discourse.julialang.org/t/run-start-doesnt-work/109552>\
**Category:** New to Julia\
**Created:** [February 1, 2024, 6:28am UTC](https://discourse.julialang.org/t/run-start-doesnt-work/109552 "2024-02-01T06:28:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmsmsgood](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rmsmsgood/32/20544_2.png) [@rmsmsgood](https://discourse.julialang.org/u/rmsmsgood)\
**Post date:** [February 1, 2024, 6:28am UTC](https://discourse.julialang.org/t/run-start-doesnt-work/109552/1 "2024-02-01T06:28:33Z")

</div>

I used my python program to open webpage automatically.

```python
import os
os.system("start https://discourse.julialang.org/")

```

But julia version can’t, even `git` commands are working. Any help?

```julia
PS C:\Users\rmsms> start https://discourse.julialang.org/
PS C:\Users\rmsms> julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.10.0 (2023-12-25)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> run(`start https://discourse.julialang.org/`)
ERROR: IOError: could not spawn `start https://discourse.julialang.org/`: no such file or directory (ENOENT)

```

## Env

- julia 1.10
- windows 11
  - window terminal 1.18.3181.0

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [February 1, 2024, 6:34am UTC](https://discourse.julialang.org/t/run-start-doesnt-work/109552/2 "2024-02-01T06:34:53Z")

</div>

I am guessing that `start` is not a program you have on your computer,  
but rather a powershell intrinstic.

Julia’s `run` command doesn’t run inside any shell.

Try running your browser directly,  
e.g.

```julia
run(`firefox https://discourse.julialang.org/`)

```

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [February 1, 2024, 11:45pm UTC](https://discourse.julialang.org/t/run-start-doesnt-work/109552/3 "2024-02-01T23:45:47Z")

</div>

It’s actually, for default browser:

```julia
run(`xdg-open https://discourse.julialang.org/`)

```

which for me was firefox, I hadn’t set it to edge, so I started it unwantingly…

The correct way is platfoem-specific, most likely doesn’t work on Windows (does on macOS?), so arguable could be in Base, or already in a package?

I see now you’re on Windows:

> <https://stackoverflow.com/questions/3739327/launching-a-website-via-windows-commandline>

There’s also another option…:

> <https://askubuntu.com/questions/8252/how-to-launch-default-web-browser-from-the-terminal>

---

<div class="post-metadata">

**Author:** ![PeterSimon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petersimon/32/25193_2.png) [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Post date:** [February 2, 2024, 12:24am UTC](https://discourse.julialang.org/t/run-start-doesnt-work/109552/4 "2024-02-02T00:24:54Z")

</div>

> [@Palli](#):
>
> The correct way is platfoem-specific, most likely doesn’t work on Windows (does on macOS?), so arguable could be in Base, or already in a package?

See package [DefaultApplication.jl](https://github.com/tpapp/DefaultApplication.jl) for a platform-independent solution.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [February 2, 2024, 12:01pm UTC](https://discourse.julialang.org/t/run-start-doesnt-work/109552/5 "2024-02-02T12:01:20Z")

</div>

@tpapp, I see one bug, sort of, there:

```julia
@static if Sys.isapple()

```

This means the package works, usually (and makes compiled code smaller), but _I believe_ if you cross-compile on e.g. macOS, for Windows, then you get the wrong macOS behavior on Windows… (am I wrong, or if not is `@static` a sort of code-smell for AppBundler/PackageCompiler?). Since the code is basically 80 lines, and not speed- nor compiled-code-size-critical, do without this?

I sort of recalled this package, and it’s not just to start web browsers, all sort of files, e.g. JPEG, in some viewer, or text files in an editor. Given how useful, and that people are likely to hard-code platform-specific behavior, e.g. for Windows, use notepad…, people should use this solution, and I could argue adding it to Base. I know it doesn’t strictly need to be there, but for discoverability would be good or at least in Julia’s docs.
