I am using Stata both in the GUI and running scripts in batch mode using a slurm cluster. The filepaths need to be established differently in each use case but I would like to have one .do file where all of the paths are defined.

Is there a way to write a falsifiable if statement that can evaluate to true if run from the GUI and false if run in batch?

Something akin to

Code:
    glob using_gui = T
    if $using_gui == T {
        glob dir "/mydir" } else {
             glob dir "D:/mydir" }
But where $using_gui is automatically determined as T or F