Psh: Cmd.exe Replacement

Developed or developing a new product in PureBasic? Tell the world about it.
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Psh: Cmd.exe Replacement

Post 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:

Image

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!
Last edited by Killswitch on Wed Sep 27, 2006 9:43 pm, edited 1 time in total.
~I see one problem with your reasoning: the fact is thats not a chicken~
thamarok
Enthusiast
Enthusiast
Posts: 282
Joined: Wed Sep 06, 2006 1:37 pm

Post by thamarok »

Looks nice :o . 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 :twisted: )
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

I was wondering if there was something like that avaliable - thanks for the tip!
~I see one problem with your reasoning: the fact is thats not a chicken~
User avatar
jqn
User
User
Posts: 97
Joined: Fri Oct 31, 2003 3:04 pm

Post by jqn »

Good idea. :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
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

I've updated it - and now it can run commands!
~I see one problem with your reasoning: the fact is thats not a chicken~
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

I noticed this offering does not support "exit". Can you build that in too?

TIA
Intrigued - Registered PureBasic, lifetime updates user
stubbsi
User
User
Posts: 50
Joined: Tue Jul 04, 2006 8:59 pm
Location: Mt Martha, Australia

Post by stubbsi »

what about command history using the up/down arrow keys.

most unix shells such as bash/csh have this facility

TIA
Vincit qui primum gerit
"The Old Farts Wins" or "He Conquers Who First Grows Old"
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

Unless I'm misunderstanding you that's already implimented with the arrows on the side?
~I see one problem with your reasoning: the fact is thats not a chicken~
User avatar
jqn
User
User
Posts: 97
Joined: Fri Oct 31, 2003 3:04 pm

Post 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
..::Origin::..
Enthusiast
Enthusiast
Posts: 125
Joined: Sat Jun 17, 2006 3:15 pm

Post by ..::Origin::.. »

I get the same error. Looks good though.
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

That's weird, I don't get that. You guys are on XP?
~I see one problem with your reasoning: the fact is thats not a chicken~
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Killswitch wrote:That's weird, I don't get that. You guys are on XP?
No i'm at home ... :lol:
User avatar
jqn
User
User
Posts: 97
Joined: Fri Oct 31, 2003 3:04 pm

Post 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”.
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post 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.
~I see one problem with your reasoning: the fact is thats not a chicken~
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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.
Post Reply