# Running ROOT to a folder containing C++ code

**URL:** <https://root-forum.cern.ch/t/running-root-to-a-folder-containing-c-code/35832>\
**Category:** Newbie\
**Tags:** tree\
**Created:** [August 30, 2019, 5:44pm UTC](https://root-forum.cern.ch/t/running-root-to-a-folder-containing-c-code/35832 "2019-08-30T17:44:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shamim](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/shamim/32/19667_2.png) [@Shamim](https://root-forum.cern.ch/u/Shamim)\
**Post date:** [August 30, 2019, 5:44pm UTC](https://root-forum.cern.ch/t/running-root-to-a-folder-containing-c-code/35832/1 "2019-08-30T17:44:50Z")

</div>

I am a complete beginner in ROOT. I want to run a C++ script written in Emacs, which is saved in certain folder but not in ROOT original folder. In that case how can I run that script using ROOT to that directory, that is my question. Thank You!

---

<div class="post-metadata">

**Author:** ![amroo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/amroo/32/33053_2.png) [@amroo](https://root-forum.cern.ch/u/amroo)\
**Post date:** [August 30, 2019, 7:56pm UTC](https://root-forum.cern.ch/t/running-root-to-a-folder-containing-c-code/35832/2 "2019-08-30T19:56:03Z")

</div>

just do “root file.c” in the folder where you have file.C .that should do the job.

---

<div class="post-metadata">

**Author:** ![marty1885](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/marty1885/32/19232_2.png) [@marty1885](https://root-forum.cern.ch/u/marty1885)\
**Post date:** [September 2, 2019, 10:35am UTC](https://root-forum.cern.ch/t/running-root-to-a-folder-containing-c-code/35832/3 "2019-09-02T10:35:35Z")

</div>

You can also add the `-q` flag so root shutdown after executing the script (don’t use this flag when using GUI), `-l` disables the banner. They make your experience better.
