I want to have a deeper understanding of how C programmes are run.
But IDEs stops us from doing that.
So is it possible that I manually set up the environment an
If you want to see how the build works, most if not all IDE's create a build log which shows the actual command lines issued to invoke the compiler/linker etc. Nothing prevents you from issuing these commands directly on the command line.
What an IDE typically also does for you is dependency management; this is difficult to maintain manually, and best left to the IDE for large projects.
You do not need to download and install any specific compiler or toolchain as some have suggested; the one you have with your current IDE will be sufficient. For example if you have VC++2008 (or 2008 Express), the command line tools are described here.