Run regedit and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor Add String Value entry with the name AutoRun and the full path of your .bat/.cmd file. e.g. %USERPROFILE%\dotfiles\cmd\alias.cmd