Usually this calls for a a build system, e.g. a build script or something, that you use for specific projects which require GtkD or something else.
For example (I'm assuming you're on win32), you could have this batch file (build.bat): http://codepad.org/vt0TskPy And you could invoke it via "build main.d". The "%%~na" nonsense kills the extension of a file, and then '.exe' is appended to it. "%*" are any arguments passed to the batch file (in this case main.d). Or you could use a makefile, or some semi-automated build system (I don't use any because none seem stable or they're too complicated). Typically I use RDMD for quick testing and a batch file or a D script for building projects.