D
David Trimboli
This may seem an odd question.
Is there any way to run a batch script from anything other than a .bat
or .cmd file?
In Unix, I can create a batch file of any name, then run, for instance,
sh <filename>
to execute the batch.
In cmd.exe, the same doesn't work.
I'm not trying to do anything in particular; I was just wondering if
there is a way to do this that I hadn't thought of.
The reason this occurs to me is that I like to mimic Unix's habit of
using .* files for configuration, so my cmd autorun file is ".cmd", my
mail signature is ".signature", my macro file is ".doskey", and so on.
However, since I prefer not to view file extensions for known file
types, ".cmd" is displayed in Windows Explorer as a file without a name,
but which runs as a batch file. Thus, I wondered if there was a way to
create a ".autorun" file or some such which could be run directly as a
batch file.
(Sure, I could create a macro or something that secretly renames the
file with a .cmd, runs the batch, then renames the file back again, but
that's cheating!)
Is there any way to run a batch script from anything other than a .bat
or .cmd file?
In Unix, I can create a batch file of any name, then run, for instance,
sh <filename>
to execute the batch.
In cmd.exe, the same doesn't work.
I'm not trying to do anything in particular; I was just wondering if
there is a way to do this that I hadn't thought of.
The reason this occurs to me is that I like to mimic Unix's habit of
using .* files for configuration, so my cmd autorun file is ".cmd", my
mail signature is ".signature", my macro file is ".doskey", and so on.
However, since I prefer not to view file extensions for known file
types, ".cmd" is displayed in Windows Explorer as a file without a name,
but which runs as a batch file. Thus, I wondered if there was a way to
create a ".autorun" file or some such which could be run directly as a
batch file.
(Sure, I could create a macro or something that secretly renames the
file with a .cmd, runs the batch, then renames the file back again, but
that's cheating!)