none
What is the difference between the Command Prompt and Windows Powershell?

Answers

  • Windows PowerShell™ is a task-based command-line shell and scripting language designed especially for system administration. Built on the .NET Framework, Windows PowerShell™ helps IT professionals and power users control and automate the administration of the Windows operating system and applications that run on Windows.

     

    Built-in Windows PowerShell commands, called cmdlets, let you manage the computers in your enterprise from the command line. Windows PowerShell™ providers let you access data stores, such as the registry and certificate store, as easily as you access the file system. In addition, Windows PowerShell™ has a rich expression parser and a fully developed scripting language.

     

    Windows PowerShell™ includes the following features:

     

    Cmdlets for performing common system administration tasks, such as managing the registry, services, processes, and event logs, and using Windows Management Instrumentation.

     

    A task-based scripting language and support for existing scripts and command-line tools.

     

    Consistent design. Because cmdlets and system data stores use common syntax and naming conventions, data can be shared easily and the output from one cmdlet can be used as the input to another cmdlet without reformatting or manipulation.

     

    Simplified, command-based navigation of the operating system, which lets users navigate the registry and other data stores by using the same techniques that they use to navigate the file system.

     

    Powerful object manipulation capabilities. Objects can be directly manipulated or sent to other tools or databases.

     

    Extensible interface. Independent software vendors and enterprise developers can build custom tools and utilities to administer their software.

     

    For more information, please refer to the following links:

     

    http://msdn.microsoft.com/en-us/library/ms714418(VS.85).aspx

     

    http://technet.microsoft.com/en-us/magazine/2007.02.powershell.aspx

     

    Good luck!


    Arthur Li - MSFT
    Thursday, November 26, 2009 8:47 AM
  • Powershell has a default blue background and Command Prompt has a default black background.
    Thursday, November 26, 2009 5:58 AM
  • Nice summary, Arthur.

    To add definition for the other half of the question:

    A CMD window, by contrast, gives you the ability to run commands and batch files that date, syntax-wise, back to DOS.

    -Noel

    Friday, November 27, 2009 12:54 AM

All replies

  • Powershell has a default blue background and Command Prompt has a default black background.
    Thursday, November 26, 2009 5:58 AM
  • Windows PowerShell™ is a task-based command-line shell and scripting language designed especially for system administration. Built on the .NET Framework, Windows PowerShell™ helps IT professionals and power users control and automate the administration of the Windows operating system and applications that run on Windows.

     

    Built-in Windows PowerShell commands, called cmdlets, let you manage the computers in your enterprise from the command line. Windows PowerShell™ providers let you access data stores, such as the registry and certificate store, as easily as you access the file system. In addition, Windows PowerShell™ has a rich expression parser and a fully developed scripting language.

     

    Windows PowerShell™ includes the following features:

     

    Cmdlets for performing common system administration tasks, such as managing the registry, services, processes, and event logs, and using Windows Management Instrumentation.

     

    A task-based scripting language and support for existing scripts and command-line tools.

     

    Consistent design. Because cmdlets and system data stores use common syntax and naming conventions, data can be shared easily and the output from one cmdlet can be used as the input to another cmdlet without reformatting or manipulation.

     

    Simplified, command-based navigation of the operating system, which lets users navigate the registry and other data stores by using the same techniques that they use to navigate the file system.

     

    Powerful object manipulation capabilities. Objects can be directly manipulated or sent to other tools or databases.

     

    Extensible interface. Independent software vendors and enterprise developers can build custom tools and utilities to administer their software.

     

    For more information, please refer to the following links:

     

    http://msdn.microsoft.com/en-us/library/ms714418(VS.85).aspx

     

    http://technet.microsoft.com/en-us/magazine/2007.02.powershell.aspx

     

    Good luck!


    Arthur Li - MSFT
    Thursday, November 26, 2009 8:47 AM
  • Nice summary, Arthur.

    To add definition for the other half of the question:

    A CMD window, by contrast, gives you the ability to run commands and batch files that date, syntax-wise, back to DOS.

    -Noel

    Friday, November 27, 2009 12:54 AM
  • How funny answer blue and black bg :p
    Thursday, May 06, 2010 11:28 AM
  • you should see this to explore the power behind the power shell scriptinghttp://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx
    Thursday, May 06, 2010 11:35 AM
  • Thnx for ur answer. it really helped me to navigate many things. I became a top notch technician because of your ans.

     

     

    Tuesday, December 14, 2010 7:40 PM
  • Hi Noel, you said.. A CMD window, by contrast, gives you the ability to run commands and batch files that date, syntax-wise, back to DOS.

    And Arthur wrote: A task-based scripting language and support for existing scripts and command-line tools.

     

    So, is Powershell able to do everything that the CMD Window can do, and more.. OR are there still things that the CMD window allows you to do that aren't available to Powershell. Assuming of course I'm logged onto windows and not in DOS.. (oh I'm in a Windows 7 forum - So also: Can you still get to DOS under Win7?)

    And I do like being able to get the Full screen window of Powershell, though the blue background isn't so good.

     

    Regards, pkn2011


    If my post was helpful - give it a Vote. If it helps solve your problem - propose it as Answer. ;-)
    Friday, July 29, 2011 12:42 PM
  • I'm no powershell expert, but in general answer to your question, because there are different commands in each "language", each would have some things it could directly do better than the other.  But you can't say one's "better" than the other - they're both good tools... 

    There are many 3rd party applications that run as command line tools, so for example you can even run unix shell-like commands in a CMD window with appropriate installation of the Gnu Toolkit.  Whether you can run these commands in a PowerShell window...  I don't know.

    You seem to be seeking an answer akin to "Learn this one, and forget about the other one".  I don't think such an answer can be given.  It is good to know about both.

    Regarding your question about DOS...  The simple answer is no - DOS is not the basis of Windows 7.  That stopped when Windows NT was released.  The CMD window implements commands like DIR and CD that have their roots in the DOS world, but it is not DOS, per se.

    That said, you can actually get DOS emulators (e.g., for playing old games) that run in Windows.  Search for DOSBox for example.

    -Noel

    Tuesday, August 02, 2011 2:15 AM
  • Hi Noel, you said.. You seem to be seeking an answer akin to "Learn this one, and forget about the other one". I don't think such an answer can be given. It is good to know about both.

    Well, it's not so much that, but in days past I've programmed in AmigaDOS, PC DOS (BATs mainly), AmigaBasic, aRexx, and written some fairly intense scripts to Automate BBS/Hosting tasks - I'm trying to find a language to go forward with for the new age of Win7 and beyond - something that's task oriented. So you can nest EXEs into your 'scripts' etc.

    I'm just trying to determine the best path for me to take going forward - perhaps just to write apps, or even something more complex. PowerShell seems to be something that'd suit my previous ability to script, as I really don't want to learn say C+ etc.

    Java I thought was another possibility too - tho I suspect you can run Java script in a Powershell environment?

    I've not seriously coded much of anything since the last millenium. But I'm sensing a renewed enthusiasm for it all.. :-)

    Many thanks for your reply.

    Regards, Peter


    If my post was helpful - give it a Vote. If it helps solve your problem - propose it as Answer. ;-)
    Tuesday, August 02, 2011 4:24 AM
  • How to move forward with scripting is a fair question.

    The ability to learn and use the tool is one aspect, and you do have to be willing to invest a good bit of effort into becoming adept with a scripting solution.

    Because of exposure to a procedural scripting language WAYYY back in the days of Windows 3.11 for Workgroups, when we purchased a product called Norton Desktop for all our Engineers and set up some quite complex tools, I have kept up with a subscription to a tool called WinBatch.  It's a bit like a lot of other languages, and it can control things on the GUI desktop.  I've even written installers with it.  It has evolved over time, and it actually can access object-oriented functionality, but its basis is procedural (meaning it has program flow, top to bottom, something like a basic or C program.  What I like about WinBatch is that it's quite well documented.  The Help file / manuals it ships with are excellent, and I can always find out how to do whatever I need in short order.  As such, I've never embraced PowerShell because I simply haven't needed to.  One of the coolest things about WinBatch is that the interpreter and the script can be encapsulated in one executable - a "compile" operation of sorts - which can then be run on any system.

    I don't know whether I would advise someone, at this date, to go buy WinBatch vs. learning Microsoft's PowerShell, though.  It was an easy choice when all Microsoft offered was the BAT processor.

    -Noel


    Tuesday, August 02, 2011 2:54 PM
  • HI Noel, you said.. One of the coolest things about WinBatch is that the interpreter and the script can be encapsulated in one executable - a "compile" operation of sorts - which can then be run on any system.

     

    One particular idea I had in mind - an education compilation - originally developed on paper that I've wanted to turn into a stand-alone "program" the data is there overall - but how to evolve it into some format that was marketable has been the long-standing unanswered question.

    Although it'd be possible just to set it up simply as an integrated series of web pages - that's never inspired me as the best way to go forward.. I'd thought perhaps VisualBASIC might be an option, but a friend (who previously wrote an Amiga BBS package - to which I contributed 'DOORs' [in AmigaBASIC]) has looked into different BASICs on the PC and not been really happy with any due to comms limitations primarily. 

    So at this point while guaging the what - rather than the how to -  I'm certainly keeping an open mind and trying to begin building up an appropriate toolkit first, so WinBatch is certainly worth looking into further I think then. :) 

    But are you somehow alluding to the approaching end for it though? When you say "Run on any System" I guess you mean PC's - what about for the mobile type devices - which seems from a consumer POV are a rapidly expanding market, something I'd definitely need to include when considering any future software development.

    Thanks, pkn


    If my post was helpful - give it a Vote. If it helps solve your problem - propose it as Answer. ;-)
    Tuesday, August 02, 2011 3:55 PM
  • Right, WinBatch just runs on Windows PCs.  It may never adapt to the world of mobile devices (which at the moment seem to me to be more of a distraction than a help, though it would certainly be good to author a million-selling game).

    Thinking ahead to try to position oneself well to author content across many different devices is a noble goal.  It's not easy though; there are still pretty fundamental differences in writing executable software for Apple vs. Microsoft platforms.  Your web pages idea isn't really a bad one.

    -Noel

    Tuesday, August 02, 2011 4:09 PM
  • Hi Noel, I was re-reading back when I noticed..  so for exampleyou can even run unix shell-like commands in a CMD window with appropriate installation of the Gnu Toolkit. Whether you can run these commands in a PowerShell window... I don't know.

     

    Hmm, Unix is fairly similar to AmigaDOS but with more case sensitivity and enhanced comms. Also it's still a living platform too.  Perhaps the Gnu Toolkit is a more portable idea. In one of the mp3s in the Technet 'talks' about powershell they were discussing mobile devices too. So I think I should investigate this angle a bit more also..

    Thanks again. Pkn


    If my post was helpful - give it a Vote. If it helps solve your problem - propose it as Answer. ;-)
    Tuesday, August 02, 2011 5:57 PM
  • In the cmd prompt, if you want to run a 'hello world' script, it's easy.  In powershell, you just get 'permission denied'.  :)

     

    Tuesday, August 02, 2011 9:44 PM
  • Hi Noel. you also said..  That said, you can actually get DOS emulators (e.g., for playing old games) that runin Windows. Search for DOSBox for example.

    DOS emulators. That takes me back to when I was playing in Networked PC games like Hack&Slash - and several others. I had it set up so the Mailer (on Amiga) grabbed packets, piped them into my PC card therein, and piped them back out after processing, and then dispatched them via the mailer again to other systems.

    People were surprised I was playing them (well, when I did) on an Amiga.. The only downside was only a Local terminal let you get in to play. None of the users could get to them remotely.. That setup is trapped on my old system though. And I guess ASCII/ANSI games aren't in huge demand nowadays.. :))

    As another tool for the ToolBox though it's worth a look though as well.

    Thanks, pkn


    If my post was helpful - give it a Vote. If it helps solve your problem - propose it as Answer. ;-)
    Wednesday, August 03, 2011 5:33 AM
  • Hi JS2010, you said..  In the cmd prompt, if you want to run a 'hello world' script, it's easy. In powershell, you just get 'permission denied'. :)

     

    Ahh, so confirmation there ARE specific differences between the two. Thanks JS!

    Regards, pkn


    If my post was helpful - give it a Vote. If it helps solve your problem - propose it as Answer. ;-)
    Wednesday, August 03, 2011 5:41 AM
  • Hi Noel, you said..  though it would certainly be good to author a million-selling game).

     

    Agreed, I've already some ideas for Apps. I won't get into specifics - but if I had a mobile device I'm not sure what I've got in mind would be something already part of the existing collections.. 8-)

    My web-pages idea certainly hasn't been eliminated, I did set up a website a few years ago just to begin learning how to work with Http - but content security seemed to be a definite concern if I went down that path.

     

    Regards, pkn


    If my post was helpful - give it a Vote. If it helps solve your problem - propose it as Answer. ;-)
    Wednesday, August 03, 2011 5:57 AM
  • In the cmd prompt, if you want to run a 'hello world' script, it's easy.  In powershell, you just get 'permission denied'.  :)

     


    The "Power" part of "PowerShell" also stands for "Power User", who understands permissions.  ;)

    http://scriptlore.com/powershell/execution-policy/

    -Noel


    Wednesday, August 03, 2011 5:41 PM
  • Ahh, there's a Windows Powershell forum - that should be helpful. :-)

    Gotta start somewhere, pkn2011


    If my post was helpful - give it a Vote. If it helps solve your problem - propose it as Answer. ;-)
    Wednesday, August 03, 2011 7:11 PM
  • You forgot one ™ on 4th line.
    Wednesday, March 27, 2013 2:03 PM
  • you can assign any color you want to command prompt :) funny answer

    Wednesday, January 15, 2014 11:03 PM
  • I enjoy this answer than the color one.
    Tuesday, February 25, 2014 6:25 AM