Code: Select all
cmd.exe "c:\imcmdfile"
cmd.exe "c:\cmdfile.whateverextension"
is it possible
thanks
Moderator: DosItHelp
Code: Select all
cmd.exe "c:\imcmdfile"
cmd.exe "c:\cmdfile.whateverextension"
Acy Forsythe wrote:Have you tried it?
If you have multiple files with the same name you could run into problems but yes you can run a command or executable without the .exe or .bat, etc...
Acy Forsythe wrote:
Have you tried it?
benham wrote:But I think the question is, does a batch file have to have a .BAT or .CMD extension in order for it to be interpreted as a batch script (We are talking the file itself, not the call)
Maybe there is a file association that can be made in the registry somewhere, but othererwise, I don't think it can be done for batch scripts. I think they need .BAT or .CMD extensions.
Code: Select all
HKEY_CLASSES_ROOT\.whateverext
@="whateverextfile"
HKEY_CLASSES_ROOT\whateverextfile\shell\open\command
@="cmd.exe \"%1\" "
Code: Select all
[HKEY_CLASSES_ROOT\cmdfile\shellex]
[HKEY_CLASSES_ROOT\cmdfile\shellex\DropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"
[HKEY_CLASSES_ROOT\cmdfile\shellex\PropertySheetHandlers]
[HKEY_CLASSES_ROOT\cmdfile\shellex\PropertySheetHandlers\PifProps]
@="{86F19A00-42A0-1069-A2E9-08002B30309D}"
[HKEY_CLASSES_ROOT\cmdfile\shellex\PropertySheetHandlers\ShimLayer Property Page]
@="{513D916F-2A8E-4F51-AEAB-0CBC76FB1AF8}"