Author Topic: dos aliases?  (Read 1757 times)

Master of Reality

  • VIP
  • Member
  • ***
  • Posts: 4,249
  • Kudos: 177
    • http://www.bobhub.tk
dos aliases?
« on: 2 August 2002, 15:38 »
is there an equivalent to aliases in DOS? I want to change the deltree or format command to have an aliases of dir or cd(not on my own windows computer, but someone elses)
Disorder | Rating
Paranoid: Moderate
Schizoid: Moderate
Linux User #283518
'It takes more than a self-inflicted gunshot wound to the head to stop Bob'

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
dos aliases?
« Reply #1 on: 2 August 2002, 21:45 »
"dir" and "cd" are built-in commands to the COMMAND.COM shell.  The only way to change them would be to hack COMMAND.COM.  DOS is brain dead.
Someone please remove this account. Thanks...

saddlemagic

  • Member
  • **
  • Posts: 43
  • Kudos: 0
dos aliases?
« Reply #2 on: 3 August 2002, 03:25 »
I recall doing things like that. It was some years ago and the archived memories take time to access. I think we used third party programs, something out of DOS-Power Tools from PC Magazine or the like.

Depending on the path statement or the working directory, you might get away with pulling something like that through a batch file.

I'll think on it a little bit. Do you have any other commands than CD of DIR that could be used? As already mentioned, they are internal to Command.com and are somewhat protected.

How bad do you want to "mess" with this 'puter?
Bitter? I'm not bitter. After seeing what Bill Gates and MicroSoft has inflicted upon us. I wish Bill would choke on a cheese sandwich and put us out of his misery.

beltorak0

  • Member
  • **
  • Posts: 223
  • Kudos: 0
    • http://www.angelfire.com/realm/beltorak
dos aliases?
« Reply #3 on: 3 August 2002, 03:40 »
i still have that book.  It's where i learned assembly.  load command.com into debug; you can only replace it with a command of the same length; so you're limited to two chars for "cd"; however, you can change "cd" to "  " and change "chdir", giving you a whole three more letters to play with.
make sure you back up command.com; it suckes when you get "invalid command.com.  insert system disk into drive <whatever>".  I had to re-buy DOS 3.3 twice because of being stupid -- well, my dad bought it.  Anyway.

You can also change the filenames "autoexec.bat" and "config.sys" if you're so inclined -- they can be anything that will fit into the space provided... change it to "system/i.vf2" if you really want. it'll work.  truely brain dead indeed.

-t.
from Attrition.Org
 
quote:
Like many times before, Microsoft is re-inventing the wheel and opting for something other than round.

-t.


saddlemagic

  • Member
  • **
  • Posts: 43
  • Kudos: 0
dos aliases?
« Reply #4 on: 3 August 2002, 04:08 »
PowerTools was great. You had 3.3 I believe that was the first. There was also PowerTools for DOS4 and DOS5. That I know of. 4 was weak, 5 kicked! As far as I know all the 3.3 routines still worked on all DOS versions.

I never had the book for 3.3, I did have the books for 4 and 5 but, unfortunatly they were lost in my last move. Bantam Publishing, $50 a pop brand new with the disks.

I do have all the software and still use a few routines on my Win3.1/DOS6.22 machine.
Bitter? I'm not bitter. After seeing what Bill Gates and MicroSoft has inflicted upon us. I wish Bill would choke on a cheese sandwich and put us out of his misery.

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
dos aliases?
« Reply #5 on: 3 August 2002, 04:54 »
But he didn't want to change the name of the command, he wanted to change what the command did. So changing "dir" to "sux" won't help him.  He wants to be able to type "cd" and have it run a different command or batch file altogether.  If it were an external command (FORMAT, FDISK, etc) then that would be easy, just rename the command and insert your trojan, but since he asked for a COMMAND.COM internal command you can't do that without replacing the COMMAND.COM with another version that does something entirely different.  Replacing COMMAND.COM would be your answer by the way.
Someone please remove this account. Thanks...

saddlemagic

  • Member
  • **
  • Posts: 43
  • Kudos: 0
dos aliases?
« Reply #6 on: 3 August 2002, 05:12 »
Thinking, thinking, thinking... That's right...

Yeah, what he needs is something to intercept the command before command.com sees it.

Wouldn't DIR.BAT be run before DIR, if DIR.BAT was in the the directory you initiated the command from?

I can't do that on this machine but to write a quick batch file named DIR.BAT that does anything but the directory command. Then type DIR from the directory it's in to see if that works.

I'm wingin' it here.
Bitter? I'm not bitter. After seeing what Bill Gates and MicroSoft has inflicted upon us. I wish Bill would choke on a cheese sandwich and put us out of his misery.

beltorak0

  • Member
  • **
  • Posts: 223
  • Kudos: 0
    • http://www.angelfire.com/realm/beltorak
dos aliases?
« Reply #7 on: 3 August 2002, 05:24 »
well, you can edit command.com to change the internal commands to something else, then create batch files for the standard names. use "attr +s +h +r cd.bat" or whatever.  You still have to edit command.com because by default dos searches thru the kernel before the path.  same with device drivers before files.

-t.

[ August 02, 2002: Message edited by: beltorak0 ]

from Attrition.Org
 
quote:
Like many times before, Microsoft is re-inventing the wheel and opting for something other than round.

-t.


saddlemagic

  • Member
  • **
  • Posts: 43
  • Kudos: 0
dos aliases?
« Reply #8 on: 3 August 2002, 05:29 »
Yep, I just barked up that tree and the bark didn't change flavor. Back to the drawing board.

My DOS is getting rusty.
Bitter? I'm not bitter. After seeing what Bill Gates and MicroSoft has inflicted upon us. I wish Bill would choke on a cheese sandwich and put us out of his misery.

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
dos aliases?
« Reply #9 on: 3 August 2002, 08:28 »
Yes, internal commands are performed first no matter what. And COMMAND.COM is not the kernel, it is a shell, equivelant to bash, ksh, csh, sh in UNIX. I'm not sure how easy it is to replace COMMAND.COM with another shell on Win9x, but in NT it's pretty easy to replace CMD.EXE with the windows version of "bash" or "ksh". That oughtta throw em for a loop.

In Win9x and below it would probably go something like:

SET COMSPEC=C:\BASH.EXE

in the AUTOEXEC.BAT or

SHELL=C:\BASH.EXE

in the CONFIG.SYS but I'm not going fire up Winblows to find out...

Of course remember that COMMAND.COM is also responsible for executing *.BAT files. Bash would not be able to execute batch files but would be able to execute Bash scripts.

[ August 02, 2002: Message edited by: VoidMain ]

Someone please remove this account. Thanks...

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
dos aliases?
« Reply #10 on: 3 August 2002, 20:22 »
That's not an alias. It's nothing more than adding a directory to your PATH.  Every luser should know how to do that. Again, you can not alias internal commands (actually you can't "alias" period) in DOS. You can not create a "cd.bat" in DOS/Windows and run it by typing "cd", no matter what you do to your path..

[ August 03, 2002: Message edited by: VoidMain ]

Someone please remove this account. Thanks...

choasforages

  • VIP
  • Member
  • ***
  • Posts: 1,729
  • Kudos: 7
    • http://it died
dos aliases?
« Reply #11 on: 3 August 2002, 23:09 »
well, my question, is since "ich nicht spreken sie dos" /*really shitty germen i think, just forget it*/ how do i make ls list and cp copy
x86: a hack on a hack of a hackway
alpha, hewlett packed it A-way
ppc: the fruity way
mips: the graphical way
sparc: the sunny way
4:20.....forget the DMCA for a while!!!

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
dos aliases?
« Reply #12 on: 4 August 2002, 10:31 »
Do you mean in Linux?  As in:

alias copy=cp
Someone please remove this account. Thanks...

sporkme

  • Member
  • **
  • Posts: 501
  • Kudos: 149
    • http://sporkme.net/
dos aliases?
« Reply #13 on: 6 August 2002, 05:25 »
yes the batch (.bat) file is the simplest solution, just make sure it doesn't replace another command.

new dos is all crippled though. good luck using it to to much more than basic file commands and starting programs.
just that you do not take an interest in politics does not mean that politics will not take an interest in you.  -pericles 430 b.c.

voidmain

  • VIP
  • Member
  • ***
  • Posts: 5,605
  • Kudos: 184
    • http://voidmain.is-a-geek.net/
dos aliases?
« Reply #14 on: 6 August 2002, 05:35 »
But replacing a command is exactly what he wants to do. Hence the word "alias". For the 4th time, you can not replace or alias a DOS builtin command with a batch file.
Someone please remove this account. Thanks...