How to define a DOSKEY alias for multiple commands? How to define a DOSKEY alias for multiple commands? windows windows

How to define a DOSKEY alias for multiple commands?


The command separator for DOSKEY is $T

For your example:

DOSKEY nss=npm start $T npm run serve


I looked at an answer to a question on superuser. The following approach resolved my problem:

@echo offDOSKEY nss=npm start ^&^& npm run serve


Try writing it as a batch file and then calling the batch file use the DOSKEY command

REM do_npm.batnpm startnpm run serve

Then, run the DOSKEY command

DOSKEY npm=do_npm.bat

See if that works for you