Jump to content



Photo

Windows 8: cmd or Powershell?


  • Please log in to reply
47 replies to this topic

Poll: cmd vs Powershell

This is a public poll. Other members will be able to see which options you chose

Which would you like to see in Windows 8?

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.
Vote Guests cannot vote

#31 Gerowen

Gerowen

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 28-August 05
  • Location: Hills of Kentucky
  • OS: Ubuntu Linux

Posted 31 October 2011 - 00:56

Windows needs a more powerful default command interpreter. Powershell is worlds ahead of the stock "cmd", and seems to effectively rival things like BASH in *nix by allowing complex scripting and greater access to system resources.

The old school cmd needs to go away, especially since Powershell can run all the normal commands anyway.


#32 +BeerFan

BeerFan

    Neowinian Senior

  • Joined: 19-July 06

Posted 31 October 2011 - 05:44


You invoke cmd to ping? I just do Windows+R and then ping from the run prompt.


if you do it that way, the cmd window disappears as soon as the pings finish.

#33 rajputwarrior

rajputwarrior

    olé olé olé olé

  • Joined: 20-June 04
  • Location: BC, CANADA

Posted 31 October 2011 - 05:50

i just use powershell for windows server stuff...

on a client machine i use CMD

#34 OP htcz

htcz

    Neowinian Senior

  • Joined: 22-July 11

Posted 31 October 2011 - 09:44

It seems many people here don't understand what CMD is.

Short explanation: CMD is a console window that provides basic functionality for changing the current directory (cd), showing the files and folders (dir) and a few other things (copy, auto-completion, command history...). The most important thing it does is to enable you to open files, give arguments to executables, and provide input and output for console applications.

What you're doing by calling "robocopy C:\SomeFolder C:\SomeOtherFolder" is launching robocopy.exe using "C:\SomeFolder" and "C:\SomeOtherFolder" as parameters. "tree C:\" just calls tree.com with "C:\" as a parameter. "ping google.com" calls ping.exe with "google.com" as parameter. And so on.
These programs (not commands - check your C:\Windows\System32 folder) can be used exactly the same way in PowerShell, and their output will look exactly the same.
In fact, if Microsoft set the default background color to black in PowerShell and removed the "PS" at the beginning of each line, most people wouldn't notice the difference. You would still be able to use the programs you use now.

Great post :)

cmd and Powershell are like kids toys by comparison

cmd of course but Powershell.........Powershell and bash can compete pretty good with each other :)

Cmd maybe, but don't think you've actually tried PowerShell or you wouldn't be saying that. It's quite powerful. Bash is good yes,but looking over what Bash has built in, nothing really jumps out as being something that others can't do or just doesn't apply.. most of it's goodies come from external programs or scripting languages, most of which are available to other shells.

Another good post.

Lets not make this a bash vs Powershell thread :p

wtf is powershell?

I already posted this: http://en.wikipedia....dows_PowerShell


Powershell is NOT a replacement for CMD and ALL commands do not work in the same manner or using the same syntax in the 2 environments. Many of the most commonly used ones do however.

As Aethec said, from CMD you are actually calling other programs. (stated in %PATH) so in a sense you can use all the commands in CMD in Powershell as well. There might be some conflicts with Powershell commands but thats why I stated that if a program calls cmd then executes a command, Powershell should start up in a cmd compatibility mode.


cmd can't be removed as it would break existing scripts and applications that call cmd.
Though PowerShell has aliases for many cmd built-in commands, the cmdlets for which the aliases are mapped do not support the switches of the cmd commands (e.g., you can't do "dir /w" in PowerShell). Variable syntax is also different (e.g., %windir% in cmd vs $env:windir in PowerShell).

I already commented on this :) If a program calls cmd then executes a command, Powershell should start up in a cmd compatibility mode. This way it is backwards compatible.



PowerShell is getting ever increasing usage as the underpinning for Windows administration and troubleshooting functionality. While it should see greater exposure, such as adding it to the Ribbon and the context menu ("Open PowerShell here"), cmd should not be removed to elevate PowerShell unless the use cases for cmd are covered by PowerShell. It's not like cmd is the only shell besides PowerShell that currently ships with Windows. Its presence doesn't diminish PowerShell.

That would be the only thing neccesary

Let me ask you a question. You made a poll here, right? Then you ask everyone's opinion, when someone gives it you just come with all your love for Powershell. I know the differences between CMD and Powershell and that's why I posted my goddamn opinion.

Obviously since you have no argument, you simply state it is your opinion. While I do find your opinion valid, there is no base to it therfore I can not agree with it.

#35 +DonC

DonC

    Neowinian

  • Joined: 16-August 07
  • Location: England

Posted 31 October 2011 - 09:55

I'd use powershell by default if it:

1. Started up as quickly as cmd
2. Had a convenient and reliable phrase in the start menu. PowerPoint gets in the way!

#36 OP htcz

htcz

    Neowinian Senior

  • Joined: 22-July 11

Posted 31 October 2011 - 12:35

I'd use powershell by default if it:

1. Started up as quickly as cmd
2. Had a convenient and reliable phrase in the start menu. PowerPoint gets in the way!

1. It will get better :)
2. Put "powers" and it is the first thing to come up. Come on, another lame excuse.

#37 PGHammer

PGHammer

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 31-August 03
  • Location: Accokeek, MD
  • OS: Windows 8 Pro with Media Center x64

Posted 03 November 2011 - 23:03

I don't think really think people understand what powershell is. In some ways its more powerful then bash and other ways its more awkward. But I do think it really is getting better/ more powerful with each version. In Windows 8 server powershell knowledge looks like it almost most know.


That's because PowerShell is not as well documented as the CMD interpreter - which makes sense, as CMD goes all the way back to the beginning of Windows NT itself.

PowerShell was designed as an alternative shell (similar to bash/bsh/ash/csh) for housekeeping/scripted commands primarily for the *server* side of Windows (specifically, Server 2003) - while it (like all the NT-based shell alternatives, from Microsoft and everyone else) is also usable on the desktop (XP and later, in the case of PowerShell), the documentation on the desktop side of things is rather sparse, compared to the server side of PowerShell's documentation.

(BSH is the original Bourne Shell, and has basically been superseded by bash.)

#38 surrealvortex

surrealvortex

    Neowinian

  • Joined: 15-June 07

Posted 05 November 2011 - 19:51

if you do it that way, the cmd window disappears as soon as the pings finish.


You ping, you see the response on the screen, and then the screen goes away. I can see special case scenarios where you may want the command window to persist, but for just finding out if a resource is reachable, what is the issue?

#39 +BeerFan

BeerFan

    Neowinian Senior

  • Joined: 19-July 06

Posted 05 November 2011 - 23:29

You ping, you see the response on the screen, and then the screen goes away. I can see special case scenarios where you may want the command window to persist, but for just finding out if a resource is reachable, what is the issue?


The issue on all systems I've ever done that on is that the cmd window disappears too quickly to read the results. Is that not the case in your situation??

#40 rkenshin

rkenshin

    Fists of Steel!

  • Joined: 01-October 02
  • Location: Hampshire, IL
  • OS: Windows 8 Pro, Mac OS 10.8, (VM's): Ubuntu 12.10, Fedora 17, Backtrack 5, Linux Mint, OpenSUSE

Posted 05 November 2011 - 23:42

The issue on all systems I've ever done that on is that the cmd window disappears too quickly to read the results. Is that not the case in your situation??


ping address -t

;) Ping won't stop until you use Ctrl+C

Dunno about the people saying PS takes longer to load. It loads just as quick as CMD on my system at work. I'm constantly between the two, honestly. I think because I've been using CMD so long, that its just out of natural habit.

#41 +BeerFan

BeerFan

    Neowinian Senior

  • Joined: 19-July 06

Posted 05 November 2011 - 23:58

ping address -t


Ha! Well, you didn't specify that ;-) And the person who posted that method as a suggestion didn't either.

#42 Aethec

Aethec

    Neowinian Senior

  • Joined: 02-May 10

Posted 07 November 2011 - 17:02

Ha! Well, you didn't specify that ;-) And the person who posted that method as a suggestion didn't either.

You can run any command from the search bar using either CMD or PS:
cmd /k ping google.com
powershell -noexit -command ping google.com
It opens a new CMD window and executes the command, but doesn't close afterwards.


Fun thing to do: Launch powershell.exe from CMD, or cmd.exe from PowerShell.

#43 +BeerFan

BeerFan

    Neowinian Senior

  • Joined: 19-July 06

Posted 08 November 2011 - 10:39

^ nice! Didn't know you could do that. (Y)

#44 OP htcz

htcz

    Neowinian Senior

  • Joined: 22-July 11

Posted 08 November 2011 - 10:53

You can run any command from the search bar using either CMD or PS:

cmd /k ping google.com
powershell -noexit -command ping google.com
It opens a new CMD window and executes the command, but doesn't close afterwards.

I can see in PATH being stored a variable that if you call CMD or command it executes powershell -noexit -command %s in Windows 8/

^ nice! Didn't know you could do that. (Y)

What he posted or calling cmd from Powershell and Powershell from cmd?

#45 Jose_49

Jose_49

    Neowinian Senior

  • Tech Issues Solved: 2
  • Joined: 30-July 09

Posted 08 November 2011 - 10:56

You know what's funny? It's been three weeks since I discovered the existence of PowerShell XD.



Click here to login or here to register to remove this ad, it's free!