you are all going far too complex, all you need to do is put a command line in the projec t porperties, if the project is running in IDe then the command line is whatever you set if it is not then there is no command line!!! simple as that,
I use it all the time my error checking bypasses if i am running through the IDE else error checking runs as it sould