The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
.
google unix.com



Windows & DOS: Issues & Discussions All Windows and DOS questions should go here as well. Discuss UNIX to Windows (Desktop or Server) here!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Equivalent command to 'stat' im_new Shell Programming and Scripting 6 01-15-2009 10:04 AM
I want a command in solaris equivalent to glance in HP-UX grrajeish SUN Solaris 6 06-26-2008 08:17 AM
equivalent of ptree command in zsh dhams Shell Programming and Scripting 3 09-11-2007 07:07 PM
Command equivalent to DOS mode for SCO 5.0.6 jgt UNIX for Advanced & Expert Users 3 05-11-2007 07:10 AM
SQL Spool equivalent command in DOS stevefox Windows & DOS: Issues & Discussions 2 01-17-2006 09:18 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-24-2008
milhan milhan is offline
Registered User
  
 

Join Date: Oct 2002
Location: /home
Posts: 133
what is the DOS equivalent of alias command?

how do we create aliases to commands in dos?

thanks
  #2 (permalink)  
Old 07-25-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
Plain DOS does not have support for aliases. You might want to look at 4dos / 4nt or Cygwin.
  #3 (permalink)  
Old 07-25-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,212
Or you can use an ordinairy batch file or a VB script.
  #4 (permalink)  
Old 09-13-2008
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,100
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....
  #5 (permalink)  
Old 03-22-2009
carlos25 carlos25 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 10
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
  #6 (permalink)  
Old 04-06-2009
ilan ilan is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 101
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!!
  #7 (permalink)  
Old 04-06-2009
ilan ilan is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 101
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:54 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0