# Compile and run from command prompt

**URL:** <https://root-forum.cern.ch/t/compile-and-run-from-command-prompt/13799>\
**Category:** ROOT\
**Created:** [February 16, 2012, 1:42pm UTC](https://root-forum.cern.ch/t/compile-and-run-from-command-prompt/13799 "2012-02-16T13:42:05Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![jfcaron](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/j/7c8e57/32.png) [@jfcaron](https://root-forum.cern.ch/u/jfcaron)\
**Post date:** [June 12, 2013, 8:27pm UTC](https://root-forum.cern.ch/t/compile-and-run-from-command-prompt/13799/11 "2013-06-12T20:27:27Z")

</div>

You can pass command-line arguments from your shell to your named macro as well. The macro sees it as a char \*. Here is an old post of mine doing that: [url][TString, stdarg, variable argument list?](https://root-forum.cern.ch/t/tstring-stdarg-variable-argument-list/15001/1)

So you could have your runme.C look like:

```auto
#include "TString.h"
#include "TROOT.h"

void runme(char * arg){
gROOT->ProcessLine(TString::Format(".L %s.C",arg);
gROOT->ProcessLine(TString::Format("%s t",arg);
gROOT->ProcessLine("t.Loop()");
}
```

then as long as your macro/macro\_2 defines a class with a Loop() method, you can call any of your macros with something like:

```auto

```

---

_[View the full topic](https://root-forum.cern.ch/t/compile-and-run-from-command-prompt/13799)._
