I’ve learned this nice trick from Petr Horáček aka Besir while working on Nakamotox. So the credit goes to him.
You can define custom commands via doskey (only on Windows) and then invoke them via command line. It is quite powerfull, because you can define alias for command with predefined attributes, so it save you lot of repetitive typing.
- Open any text editor and define your shortcut commands
@echo off REM example shortcut for docker-compose doskey dcdu=docker-compose -f docker-compose-dev.yml up doskey dcdd=docker-compose -f docker-compose-dev.yml down
- Add path to file with commands to registry:
- open regedit
- go to \HKEY_CURRENT_USER\Software\Microsoft\Command Processor
- define AutoRun
- enter path to file with doskey commands