Page 1 of 2
Psh: Cmd.exe Replacement
Posted: Wed Sep 27, 2006 1:26 pm
by Killswitch
I'm not a Linux user, but I have experiemented with it a little bit. Now, this may sound corny, but Linux does have some really cool consoles which actually make it a joy to go back to a CLI. Cmd.com on windows, however, is boring. And old.
So, I decided I'd make a replacement! And, here it is:
It's XP only at the moment, but I'll soon fix that

. Every command you can enter via Cmd.exe is supported.
Download Binary
Download Source
Enjoy!
Posted: Wed Sep 27, 2006 1:48 pm
by thamarok
Looks nice

. However, I think you don't need to make the commands yourself, just take the user input, execute it through RunProgram() or ShellExecute_() and pipe out the result and show it to the user. Sounds hard, but in the time I used Win 98SE, I made something similar and it got pretty much attention with my friends

(I think I removed it when I formatted my hard-drive to install Linux

)
Posted: Wed Sep 27, 2006 2:07 pm
by Killswitch
I was wondering if there was something like that avaliable - thanks for the tip!
Posted: Wed Sep 27, 2006 2:33 pm
by jqn
Good idea.
A little help for running a program and trap messages and errors:
Code: Select all
npgm = RunProgram(EXEPGM, DIRECTORY, #PB_Program_Wait|#PB_Program_Hide|#PB_Program_Open|#PB_Program_Read)
while AvailableProgramOutput(npgm)
line.s = ReadProgramString(npgm)
... examine errors and others strings....
printn(line)
wend
Posted: Wed Sep 27, 2006 9:43 pm
by Killswitch
I've updated it - and now it can run commands!
Posted: Thu Sep 28, 2006 1:36 am
by Intrigued
I noticed this offering does not support "exit". Can you build that in too?
TIA
Posted: Thu Sep 28, 2006 2:58 am
by stubbsi
what about command history using the up/down arrow keys.
most unix shells such as bash/csh have this facility
TIA
Posted: Thu Sep 28, 2006 7:58 am
by Killswitch
Unless I'm misunderstanding you that's already implimented with the arrows on the side?
Posted: Thu Sep 28, 2006 8:51 am
by jqn
Command "dir" say an error and cancel
Code: Select all
An attemped read or wite to/from an address to which that process isn't allowed
It's possible to "bold" the font? I can't see it well
Posted: Thu Sep 28, 2006 10:15 am
by ..::Origin::..
I get the same error. Looks good though.
Posted: Thu Sep 28, 2006 2:21 pm
by Killswitch
That's weird, I don't get that. You guys are on XP?
Posted: Thu Sep 28, 2006 2:23 pm
by Num3
Killswitch wrote:That's weird, I don't get that. You guys are on XP?
No i'm at home ...

Posted: Thu Sep 28, 2006 4:29 pm
by jqn
Killswitch wrote:That's weird, I don't get that. You guys are on XP?
No, I'm on w2k.
But, I think that the problem is that “dir” (and some others) they are not cmd or exe but subcommands of “cmd.exe”.
Posted: Thu Sep 28, 2006 6:10 pm
by Killswitch
I don't get that error while on XP - I do have a 2000 machine available so I'll have a look into it asap.
Posted: Thu Sep 28, 2006 6:29 pm
by Trond
Dir works here.
It looks nice but it uses 100% CPU. What he means by arrow up and down is the arrow keys on the keyboard. Just try it in cmd.exe after running some commands.