How was batch file launched?

Greetings,

A few times I have accidentally (double)-clicked a batch file. How can I tell if a batch script hasn't been launched from the console/command line? This would be similar to launching it from the Windows Run command.