Running ROOT to a folder containing C++ code

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!

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

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.