Hey!! guys i like to share this pretty cool knowledge with you that we can also create aliases in windows as we create in linux .... in windows we call it DOS key!!
DOSKEY (Wikipedia crap :p)
DOSKEY is a utility for DOS and Microsoft Windows that adds command history, macro functionality, and improved editing features to the command line interpreters
In early 1989 functionality similar to DOSKEY was introduced with DR-DOS 3.40 with its
In current Windows NT-based operating systems DOSKEY's functionality is built into CMD.EXE, although the DOSKEY command is still used to change its operation.
Practical Work
In this pic i wanna make a short and simple alias for sublime text as you can see i made it using the following command
doskey s1 = sublime_text.exe $*
and thats it ... remember i have sublime_text.exe file in my environment path variable
so now instead of typing the whole bullshit(i.e sublime_text) i just have to enter the alias that i have setted in the particular command prompt
Problem
The main problem is that if the close the session or can say when you close the cmd you doskey setup is lost :( :( and it will not work in other command prompt
Dont be sad i have a solution for it
Solution
1.) Create a new folder in the c:\windows directory called bin.
2.) Run notepad as Administrator.
3.) Enter the following command in it
@echo off
@doskey sl = sublime_text $*
4.) Now save the file as doskey.bat in the c:\windows\bin folder that we actually created
5.) press control + r and run box will open
6.) type regedit in the run box and hit enter
7.) search for HKEY_CURRENT_USER\Software\Microsoft\Command Processor
8.) Add a new String Value called AutoRun and set the absolute path in the value of c:\windows\bin\doskey.bat.
The doskey.bat file will now be executed before opening a new cmd session which will set all of your alias ready for you to use.
Now i have alias for windows same that i used in linux environment
Thanks for giving your valueable time in reading this post
Thank you !!
DOSKEY (Wikipedia crap :p)
DOSKEY is a utility for DOS and Microsoft Windows that adds command history, macro functionality, and improved editing features to the command line interpreters
COMMAND.COM
and CMD.EXE
. It was included as a TSR program with MS-DOS and PC DOS versions 5 and later, Windows 9x and Windows XP or later.In early 1989 functionality similar to DOSKEY was introduced with DR-DOS 3.40 with its
HISTORY
CONFIG.SYS
directive. This enabled a user-configurable console input history
buffer and recall as well as pattern search functionality on console
driver level, that is, fully integrated into the operating system and
transparent to running applications. In summer 1991 DOSKEY was
introduced in MS-DOS/PC DOS 5.0 in order to provide some of the same
functionality. DOSKEY also added a macro expansion facility, which,
however, required special support to be implemented in applications like
command line processors before they can take advantage of it. Starting
with Novell DOS 7 in 1993 the macro capabilities were provided by an
external DOSKEY command as well. In order to also emulate DOSKEY's
history buffer functionality under DR-DOS, the DR-DOS DOSKEY works as a
frontend to the resident history buffer functionality, which remained
part of the kernel in DR-DOS.In current Windows NT-based operating systems DOSKEY's functionality is built into CMD.EXE, although the DOSKEY command is still used to change its operation.
Practical Work
In this pic i wanna make a short and simple alias for sublime text as you can see i made it using the following command
doskey s1 = sublime_text.exe $*
and thats it ... remember i have sublime_text.exe file in my environment path variable
so now instead of typing the whole bullshit(i.e sublime_text) i just have to enter the alias that i have setted in the particular command prompt
Problem
The main problem is that if the close the session or can say when you close the cmd you doskey setup is lost :( :( and it will not work in other command prompt
Dont be sad i have a solution for it
Solution
1.) Create a new folder in the c:\windows directory called bin.
2.) Run notepad as Administrator.
3.) Enter the following command in it
@echo off
@doskey sl = sublime_text $*
4.) Now save the file as doskey.bat in the c:\windows\bin folder that we actually created
5.) press control + r and run box will open
6.) type regedit in the run box and hit enter
7.) search for HKEY_CURRENT_USER\Software\Microsoft\Command Processor
8.) Add a new String Value called AutoRun and set the absolute path in the value of c:\windows\bin\doskey.bat.
The doskey.bat file will now be executed before opening a new cmd session which will set all of your alias ready for you to use.
Now i have alias for windows same that i used in linux environment
Thanks for giving your valueable time in reading this post
Thank you !!
No comments:
Post a Comment