# Opening a notebook using C# ?

**URL:** <https://community.wolfram.com/t/opening-a-notebook-using-c/19136>\
**Category:** Questions\
**Tags:** external-interfaces, computational-notebooks\
**Created:** [November 17, 2021, 10:31am UTC](https://community.wolfram.com/t/opening-a-notebook-using-c/19136 "2021-11-17T10:31:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterleibundgut](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@peterleibundgut](https://community.wolfram.com/u/peterleibundgut)\
**Post date:** [November 17, 2021, 10:31am UTC](https://community.wolfram.com/t/opening-a-notebook-using-c/19136/1 "2021-11-17T10:31:21Z")

</div>

I can start Mathematica from C#, but the CubeOfCubes.nb argument cannot be found (The file “CubeOfCubes.nb” could not be found.).

```
    private void BtnKubus_Click(object sender, RoutedEventArgs e)
    {
        Process P = new Process();
        P.StartInfo.FileName = "C:\\Programme/Wolfram Research/Mathematica/12.2/Mathematica.exe/";
        P.StartInfo.Arguments = "CubeOfCubes.nb";
        P.Start();

```

CubeOfCubes.nb is in the same directory as Mathematica.exe. How do I have to proceed?

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [November 17, 2021, 3:19pm UTC](https://community.wolfram.com/t/opening-a-notebook-using-c/19136/2 "2021-11-17T15:19:20Z")

</div>

Usually not a good idea to drop files into an applications installation directory. Anyway, have you tried using the full path?

```
P.StartInfo.Arguments = "C:\\Programme/Wolfram Research/Mathematica/12.2/CubeOfCubes.nb";

```

---

<div class="post-metadata">

**Author:** ![peterleibundgut](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@peterleibundgut](https://community.wolfram.com/u/peterleibundgut)\
**Post date:** [November 18, 2021, 8:30am UTC](https://community.wolfram.com/t/opening-a-notebook-using-c/19136/3 "2021-11-18T08:30:25Z")

</div>

Finally, the notebook file should be integrated into the project. But as an argument in the same directory as Mathematica.exe it should work for now. Unfortunately not - not even with the full file path.

---

<div class="post-metadata">

**Author:** ![peterleibundgut](https://avatars.discourse-cdn.com/v4/letter/p/df705f/32.png) [@peterleibundgut](https://community.wolfram.com/u/peterleibundgut)\
**Post date:** [November 18, 2021, 10:41am UTC](https://community.wolfram.com/t/opening-a-notebook-using-c/19136/4 "2021-11-18T10:41:35Z")

</div>

The solution is simple:

```
    private void BtnMandelbrot_Click(object sender, RoutedEventArgs e)
    {
        const string program = "C:\\Programme/Wolfram Research/Mathematica/12.2/Mathematica.exe/";
        const string argument = "C:\\Projects/NB/Mandelbrot.nb";

        Process.Start(program, argument);
    }

```
