Here doskey cmd is used to set alias.
All alias set using 'doskey' are temporary, once you reopen a new cmd window its gone.
Let see how to set alias like in linux we save it in .bashrc file
IN WINDOWS
First open a notepad and past below commands to test
doskey ls=dir
doskey !=ping google.com -t
doskey mv=ren
save it as alias.cmd,
Open your run window and type %appdata% then enter. Copy the alias.cmd file to this Appdata-Roming folder.
Open regdit from your run window.
Go to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor
Select 'Command processor' Folder and on the right side of window, Right click - New-Expandable string value
Give 'Name' as AutoRun, then right click and modify value as "%AppData%\alias.cmd"
That's it! Now go to cmd prompt and do
ls and see it its working.
All alias set using 'doskey' are temporary, once you reopen a new cmd window its gone.
Let see how to set alias like in linux we save it in .bashrc file
IN WINDOWS
First open a notepad and past below commands to test
doskey ls=dir
doskey !=ping google.com -t
doskey mv=ren
save it as alias.cmd,
Open your run window and type %appdata% then enter. Copy the alias.cmd file to this Appdata-Roming folder.
Open regdit from your run window.
Go to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor
Select 'Command processor' Folder and on the right side of window, Right click - New-Expandable string value
Give 'Name' as AutoRun, then right click and modify value as "%AppData%\alias.cmd"
That's it! Now go to cmd prompt and do
ls and see it its working.
No comments:
Post a Comment