|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
what is the DOS equivalent of alias command?
how do we create aliases to commands in dos?
thanks |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Plain DOS does not have support for aliases. You might want to look at 4dos / 4nt or Cygwin.
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Or you can use an ordinairy batch file or a VB script.
|
|
#4
|
||||
|
||||
|
Actually, an alias to a command can be done in XP. Using regedit I created a subkey called "cpu-z" in "HKLM\SOFTWARE\Microsoft\CurrentVersion\App Paths" with a value of "C:\Utilities\cpu-z\cpuz.exe". And now when I try to run cpu-z, it works. I can replace the value with a path to any program and that works too. Also batch files work, although a cmd window pops up.
One of several little tricks I learned from battling a recent virus.... ![]() |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
I know I'm rather late on this but it might help others... You can use doskey to create an alias on any version of windows up to Windows XP (I'm not sure if it's available on Vista). Code:
C:> doskey alias_name=command doskey will only work within the environment that it's invoked in and if you want the aliases to be available every time you start cmd.exe will need to write a script that will load them upon invoking your cmd prompt (cmd /K "My_Environment_Script.bat"). Example: I often need to change drives and cd doesn't handle it very well but chdir does. However, the length of the command is tiresome to type every time I need it so I do this... Code:
doskey cdd=chdir /D %1 So when I type: cdd F: The command prompt will change to F:> More information on DosKey can be found here: DOSKey - Wikipedia, the free encyclopedia |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Carlos, if you are trying to just change teh drives, you can simply type drive letter as in below...
C:\Documents and Settings\ilango>f: F:\>e: E:\>h: H:\>c: C:\Documents and Settings\ilango> /ilan PS: ignore my comments if you are just you used this an example in your comment!! |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Hello Milhan,
on top of what Pederabo has suggested.., the oter easy way to get working similar to aliases are using a set command.. C:\Documents and Settings\ilango\test>set dira=dir /A C:\Documents and Settings\ilango\test>dir Volume in drive C has no label. Volume Serial Number is 548F-C2AD Directory of C:\Documents and Settings\ilango\test 04/06/2009 12:13 PM <DIR> . 04/06/2009 12:13 PM <DIR> .. 04/06/2009 12:13 PM 4 normal.txt 1 File(s) 4 bytes 2 Dir(s) 6,269,435,904 bytes free C:\Documents and Settings\ilango\test>%dira% Volume in drive C has no label. Volume Serial Number is 548F-C2AD Directory of C:\Documents and Settings\ilango\test 04/06/2009 12:13 PM <DIR> . 04/06/2009 12:13 PM <DIR> .. 04/06/2009 12:13 PM 4 hidden.txt 04/06/2009 12:13 PM 4 normal.txt 2 File(s) 8 bytes 2 Dir(s) 6,269,403,136 bytes free C:\Documents and Settings\ilango\test> In teh above example, i made simiar to alias - dira to be executed as dir /A, only thing is you will have to use it with percentages.. as in %dira% /ilan |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| smitty equivalent command line command | asyed123 | AIX | 2 | 09-24-2011 11:12 AM |
| equivalent ps -C command | bobprabhu | Solaris | 9 | 06-18-2010 10:02 AM |
| Need svcs equivalent command | EmbedUX | UNIX for Advanced & Expert Users | 2 | 10-07-2009 05:57 AM |
| command that is equivalent to smitty in IBM. | oracle_rajesh_k | HP-UX | 1 | 11-16-2008 06:33 AM |
| command that is equivalent to TOPAZ in IBM. | oracle_rajesh_k | HP-UX | 2 | 11-15-2008 05:03 PM |
|
|