Back in the mid-90's, I remember doing something like this:
if %1==. dir
basically, if you put the above code in dodir.bat
and run it on its own without passing it any parameters, it would run the dir command. However, if you passed it anything at all as a parameter, it would not run the dir command.
I can't seem to get this to work in my Windows 7 batch files. Perhaps I don't remember the proper syntax. Any helpers?