Skip to content

Instantly share code, notes, and snippets.

@cotyembry
Last active December 22, 2016 01:28
Show Gist options
  • Save cotyembry/30328e9d9cc6616f69e9332d3fb000ea to your computer and use it in GitHub Desktop.
Save cotyembry/30328e9d9cc6616f69e9332d3fb000ea to your computer and use it in GitHub Desktop.

Aliases in cmd.exe - This gist is about making the cmd.exe experience more custom

Below is the content of the file name that would be actually logonCommands.cmd

DOSKEY ls=dir
DOSKEY del=rm
DOSKEY c=cls
DOSKEY clear=cls
DOSKEY nrw=npm run webpack
DOSKEY nrs=npm run start

Almost done on the custom cmd for Windows. Hit Start Type cmd Right click on the cmd icon Create shortcut (and put in on the Desktop) Right click Click Properties Add something that looks like the following in the target field

C:\Windows\system32\cmd.exe /K C:\Users\JEmbry\Developer\logonCommands\logonCommands.cmd

You can create the logonCommands.cmd file using simply the text that is above I mentioned before that are indented above

Basically the /K says 'run the commands that are listed in the logonCommands.cmd file when starting up the cmd session'

As a bonus you should do the following

On your desktop now right click the cmd shortcut you made earlier Click pin to task bar

Now it is available not only on your Desktop, but also your bottom taskbar

You can also add (when you right click the icon and then click properties) in the shortcut field a keyboard command to quickly launch the cmd.exe application which is awesome Just click in the field then press any key combination and you should see it be recognized in the field. Click Apply. Click ok.

It should work now. Now you've leveled up lol

Happy coding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment