Linked by Thom Holwerda on Fri 18th Nov 2016 15:56 UTC
Windows

Command Prompt has been around for as long as we can remember, but starting with Windows 10 build 14971, Microsoft is trying to make PowerShell the main command shell in the operating system.

As a result, PowerShell officially replaces the Command Prompt in the Win + X menu, so when you right-click the Start menu, you’ll only be allowed to launch the more powerful app. Additionally, in File Explorer’s File menu and in the context menu that appears when pressing Shift + right-click in any folder, the old Command Prompt will no longer be available.

Typing cmd in the run dialog will launch PowerShell as well, so Microsoft has made a significant step towards phasing out the traditional Command Prompt.

It's funny - cmd has always been seen as a sort-of Baby's First Command Line, and compared to the shell that comes standard with any UNIX-based operating system, that was certainly true. However, now that Windows has a replacement that is much more capable than cmd, people will cry foul and hell over the possible deprecation of cmd.

Us nerds are fickle.

Thread beginning with comment 637278
To read all comments associated with this story, please click here.
CMD Should Have Been Expanded
by segedunum on Fri 18th Nov 2016 16:33 UTC
segedunum
Member since:
2005-07-06

CMD should just have been used as a starting point and expanded, which would have been fairly logical, but that's the kind of disjointed stuff you get in large companies.

Reply Score: 12

RE: CMD Should Have Been Expanded
by Kroc on Fri 18th Nov 2016 19:41 in reply to "CMD Should Have Been Expanded"
Kroc Member since:
2005-11-10

Here, here!

CMD is reliable. I can write a batch script and it will largely run as-is all the way back to a genuine MS-DOS machine. Now matter how borked a PC is, CMD will still work. It'll work in safe mode, it'll typically be the only thing working when .NET has corrupted itself for the umpteenth time.

CMD, despite all its shortcomings, is the go-to tool when you want to write something that will absolutely not dick around with you and you can rely on running the same on every PC you can imagine.

This news brings me great sadness because here I am polishing an awesome 1000-line batch script that's quite a thing of beauty despite the language's idiosyncrasies.

Reply Parent Score: 3

sbenitezb Member since:
2005-07-22

I like CMD for running scripts, but I totally hate batch scripts for more than a couple of sequential commands. I replaced stupid vbscript with jscript (which is much better thanks to exceptions) and then started using powershell for more advanced stuff. It really shines for WMI querying.

Reply Parent Score: 2

BeamishBoy Member since:
2010-10-27

Here, here!


Groan.

It's "Hear! Hear!"

Reply Parent Score: 5

Kochise Member since:
2006-03-03

Used cmd to create a 1100+ lines, 46+ kiB batch file, yet it has been hell to write and debug, io and string performances are horrible, delayed expansion made things ridiculously complex and the 8191 chars limit for a string definitively ruined everything. Will convert it to PowerShell and Linux shell as well.

Reply Parent Score: 3

dylansmrjones Member since:
2005-10-02

Hear hear!

While I liked PowerShell back in my windows days, CMD has always been my favourite for two reasons:
1) I know it well, and
2) It is snappy.

It comes handy when you have to help friends and local residents with their Windows systems. (The price of being pretty much the sole nerd on an island with almost 200 residents.)

Reply Parent Score: 2

Carrot007 Member since:
2008-02-04

I was under the impression that if your command script was .bat is operated like a batch fiel always has and if it was .cmd if used the newer methods.

Reply Parent Score: 1

henderson101 Member since:
2006-05-30

.. when .NET has corrupted itself for the umpteenth time.


Okay - that sounds like you are doing something wrong. When has this ever happened in real world? I'm sitting here, developing against .Net with a very large customer base using apps for mission critical (read: life saving) applications. If this was true, I think we'd have noticed by now. Please, back up your personal anecdotes with actual facts, or stop spreading FUD.

Reply Parent Score: 2

malxau Member since:
2005-12-04

CMD should just have been used as a starting point and expanded, which would have been fairly logical, but that's the kind of disjointed stuff you get in large companies.


Perhaps the good thing about very simple shells is they're intended to be extended via extra command line software. The only limits are to core parser logic (which in CMD's case, is quite old and limited.)

So like many other readers here, I have accumulated my own tools to work around CMD's age. The one I'm most proud of/use the most is sdir, which attempts to make dir a little less 1981. If anyone reading this is interested, it's at http://www.malsmith.net/sdir/ . There's also other tools at that site for copying HTML to the clipboard and manipulating ANSI/VT100 escape sequences, manipulating Windows shortcuts, finding where things are in a path or environment variable, etc.

I'm also curious what other readers here have done to make their CMD experience more pleasant.

Reply Parent Score: 5