Windows cmd.exe to be deposed by PowerShell

General discussion for topics related to the FreeBASIC project or its community.
Post Reply
FreeFox
Posts: 69
Joined: Sep 28, 2016 23:45

Windows cmd.exe to be deposed by PowerShell

Post by FreeFox »

caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Windows cmd.exe to be deposed by PowerShell

Post by caseih »

Well seeing as PowerShell always was a Windows-only tool for use with Windows-only things, from a Linux POV I couldn't care less what MS does. (I know PS is now released on Linux, but I have no use for it.)

As for the Windows point of view, in my mind, PS and CMD served different purposes. PS was good for scripting and controlling things like MS Exchange, MS SQL Server, and other Windows Server tasks. CMD.exe was still good at batch processing of files and simple file management. I really don't see how PS replaces CMD at those tasks. Even the simplest introduction to PS always seemed overly complicated to me. CMD.exe is a fairly primitive shell, but it's quite simple.

I highly doubt cmd.exe is going away. Probably MS will make it harder to find in the start menu, but it will be there for some years yet. There's also tcc, which is now free. And when you combine it with a nicer console program like conemu, the old venerable Windows console becomes a lot more usable.
FreeFox
Posts: 69
Joined: Sep 28, 2016 23:45

Re: Windows cmd.exe to be deposed by PowerShell

Post by FreeFox »

I don't use Linux myself but I'm not surprised that you have no use for PS given all the other shells that are available for that platform.

I remember getting quite excited when Powershell first came out in 2006 thinking that it would be a 'better' cmd.exe but, on closer inspection, it proved to be nothing of the sort! Although it's some time since I last looked at it, my impression then was that it was cryptic, over-complicated, slowish and buggy and I would therefore be sticking to cmd.exe for the forseeable future. I am sure there are plenty of other Windows developers and administrators who feel exactly the same.

What amazes me about MS is that they never seem to learn. A few years ago it looked like they were deprecating .NET which p***ed off C#/VB.NET developers big time. Now, there's been a complete reversal of that position; .NET is everywhere - or, at any rate, they'd like it to be - and PS itself is, of course, .NET based.

Now, it appears that they're trying to deprecate cmd.exe - to the point of possibly removing it altogether in a future version of Windows 10. I suspect (and certainly hope) that you're right about this and that it'll still be around - albeit harder to find - for some years to come, to appease the likely developer backlash about removing it altogether.

It may be that they're just testing the waters on this right now - we'll have to wait and see.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Windows cmd.exe to be deposed by PowerShell

Post by dodicat »

The cmd.exe got by
shell "cmd"
and compiled to startshell .exe (say) is handy to copy and paste and use in various working folders, Including the freebasic main folder.
This makes for an easy command line compile of a .bas file (to add an icon for example).
However I would NOT recommend using a powershell.exe alternative i.e.
shell "start powershell"
Last Time I tried that .exe I had to switch off the box (Win 10) at the wall.
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: Windows cmd.exe to be deposed by PowerShell

Post by Tourist Trap »

I've been reading a book (a while ago) about computers forensic inquiry. The author, expert of the question, was using a wide variety of tools to get access to the system and piloting everything via PERL (to gather the results to SDTOUT). PowerShell was only one tool among the totality and not its prefered one as far as I can remember. People will ever need low level OS commands, with low footprint, at least for forensic analysis.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Windows cmd.exe to be deposed by PowerShell

Post by marcov »

FreeFox wrote: What amazes me about MS is that they never seem to learn. A few years ago it looked like they were deprecating .NET which p***ed off C#/VB.NET developers big time. Now, there's been a complete reversal of that position; .NET is everywhere - or, at any rate, they'd like it to be - and PS itself is, of course, .NET based.
They deprecated .NET on mobile, since it was too slow, for the same reason that Android and its apps have increasing amounts of native code, and every major version has some new precompile scheme to wring some performance from the Java code.

Now that MS put mobile on ice (except for the odd Surface Pro), .NET is back.

Anyway, for programmers a shell that is more readily extensible like PS would maybe be nice.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Windows cmd.exe to be deposed by PowerShell

Post by caseih »

Are you sure about that? As far as I know universal windows apps (metro) are all dot net. And they run on arm mobile or x86. So no dot net is not dead or deprecated in mobile. And actually ms is pushing dot net as a cross platform mobile development system now that they bought Xamarin. With one code base you can target Android, iOS and windows universal executables with c#. Of course how well that actually works I can't speak to.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Windows cmd.exe to be deposed by PowerShell

Post by marcov »

caseih wrote:Are you sure about that? As far as I know universal windows apps (metro) are all dot net.
No. afaik the uwp foundation is a WinRT, a C++ framework that heavily integrates with COM.
And they run on arm mobile or x86. So no dot net is not dead or deprecated in mobile.
No, but Mobile itself is deprecated for MS. No new Lumia's are coming out anymore,
And actually ms is pushing dot net as a cross platform mobile development system now that they bought Xamarin. With one code base you can target Android, iOS and windows universal executables with c#. Of course how well that actually works I can't speak to.
That's true. But it is a target without a solid home based on a non-core .NET codebase (Xamarin's). Still, mobile could do with a helping hand in making development with a lower entry barrier, so maybe it works.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Windows cmd.exe to be deposed by PowerShell

Post by caseih »

Don't mistake Windows Phone for mobile. UWP is all about mobile. That's it's whole point. The idea is one UI and platform that can adapt to any size screen from a phone or tablet to a HiDPI desktop. Microsoft very much has not deprecated mobile. The difference is that there's no more mobile operating system. Instead Windows 10 itself runs on all devices including mobile, Xbox, the traditional desktop, Hololens, and IoT like Raspberry Pi. I just barely bought a tablet running Windows 10 (there are quite a few cheap models to choose from these days), so I can assure you MS has not abandoned mobile space. They may not make phones anymore and very few manufacturers are using Windows on phones. But mobile is definitely still a part of MS's game plan. And C# and dot net are very much first-class players in the UWP world--. In fact I'm running several C# mobile apps on my tablet that run equally well on the Lumia phone (and also the normal Desktop computer).

By the way I've been pleasantly surprised how usable this Windows 10 tablet is. It's not quite as slick or polished as Android or iOS, and the dual-mode nature of Windows (desktop vs mobile) still needs some work to get right. But the ability to run non-mobile apps still is very nice, though I don't tend to use desktop apps very much on the tablet. The project I'm working on involves a conventional windows app with a UI that works well enough for touch, so it's nice to have the ability to run conventional apps even in a touch environment. If I plug in a keyboard and mouse and a monitor, it's a full-blown desktop computer (albeit a bit sluggish). Interesting concept.

By the way if you have Windows 10 on a machine you can get a feel for what it's like on a mobile by switching it to "Tablet Mode." Apps become full-screen and the on-screen keyboard becomes available.
Last edited by caseih on Nov 23, 2016 17:00, edited 1 time in total.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Windows cmd.exe to be deposed by PowerShell

Post by marcov »

caseih wrote:Don't mistake Windows Phone for mobile. UWP is all about mobile. That's it's whole point. The idea is one UI and platform that can adapt to any size screen from a phone or tablet to a HiDPI desktop. Microsoft very much has not deprecated mobile.
They have a software platform yes, from yonder years when they still brought out new Mobile hardware.

They currently don't anymore, so it is all hypothetical since the platform has no home (give or take cramming it on a rpi or the odd overpriced surface). More importantly, the unique selling argument for the Surface Pro turns out to be running win32 apps.

Worse, Intel canned mobile x86 chips, so even for Surface they have a problem. I just saw they might solve that with emulation though.
The difference is that there's no more mobile operating system. Instead Windows 10 itself runs on all devices including mobile, Xbox, the traditional desktop, Hololens, and IoT like Raspberry Pi.
There are a handfull of hopefuls that have embraced uwp, as there always are. Most don't bother and stick to win32/win64.
I just barely bought a tablet running Windows 10 (there are quite a few cheap models to choose from these days), so I can assure you MS has not abandoned mobile space. They may not make phones anymore and very few manufacturers are using Windows on phones.

But mobile is definitely still a part of MS's game plan. And C# and dot net are very much first-class players in the UWP world--. In fact I'm running several C# mobile apps on my tablet that run equally well on the Lumia phone (and also the normal Desktop computer).
We'll see. One could as well argue that those are designins and bought products from before MS' big push for mobile/tablet was canned. Bought products as in Microsoft paying minority players to bring out tablets with their stuff.
By the way I've been pleasantly surprised how usable this Windows 10 tablet is. It's not quite as slick or polished as Android or iOS, and the dual-mode nature of Windows (desktop vs mobile) still needs some work to get right. But the ability to run non-mobile apps still is very nice, though I don't tend to use desktop apps very much on the tablet. The project I'm working on involves a conventional windows app with a UI that works well enough for touch, so it's nice to have the ability to run conventional apps even in a touch environment. If I plug in a keyboard and mouse and a monitor, it's a full-blown desktop computer (albeit a bit sluggish). Interesting concept.
For me the problem is that for most serious stuff I grab a desktop/laptop anyway, so basically the tablet is a tvguide, video and skype terminal, and usually I don't even bother to lug it around and it stays near the couch.

Strangely enough my laptop is more mobile than my tablet is :_)
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Windows cmd.exe to be deposed by PowerShell

Post by caseih »

Well, MS has always been a software company. So it makes sense that they would focus on the software platform to enable mobile rather than try to do hardware themselves, such as the Lumia phone.
marcov wrote:Strangely enough my laptop is more mobile than my tablet is :_)
I agree, for most of the things I do. For my current project, though, a laptop is definitely not appropriate, but the tablet is.

But for most folks out there, tablets are replacing laptops for a lot of basic computing and communication tasks. To me an iPad or Android tablet was never enough because of the need to run desktop apps and the need to sometimes use a keyboard and mouse. In terms of a UI, in many ways Android is a step backwards, and so was iOS. That's why Windows 10 is a bit intriguing to me, and I can see the real utility in the hybrid tablet/laptops like the Surface Pro is. I've actually seen a lot of surface pros lately being used professionally.

Back on PowerShell, the other day I wanted to list all the UWP apps installed on my windows 10 box, which I can do with a simple PowerShell command. But the output was way too verbose, so I naturally wanted to reach for grep to find the relevant lines. I did some searching and found what I thought is a grep-like PS command, but I never got it to work.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Windows cmd.exe to be deposed by PowerShell

Post by marcov »

caseih wrote:Well, MS has always been a software company. So it makes sense that they would focus on the software platform to enable mobile rather than try to do hardware themselves, such as the Lumia phone.
marcov wrote:Strangely enough my laptop is more mobile than my tablet is :_)
I agree, for most of the things I do. For my current project, though, a laptop is definitely not appropriate, but the tablet is.

But for most folks out there, tablets are replacing laptops for a lot of basic computing and communication tasks.
[/quote]

True, but I wouldn't be surprised if 95% of that usage never use anything else than apps from a list of about two dozen.

There are some differences (like games, and the odd banking app), but the point is not that I'm debating the tablets count or usage, , it is tablets as an open platform for software that I have doubts about.

Microsoft is about the only one pushing that dead horse, and it is bringing not much too the table for that battle. Can't create a market with own, affordable devices, no big demand from public.

Sure, there's always developers hoping it is the next bit thing, but they also suffered major credibility loss in several failed rounds of attempting to conquer mobile devices (as in phones and tablets).

Something major has to happen for them to have a chance, and I don't see that major chance coming atm.
To me an iPad or Android tablet was never enough because of the need to run desktop apps and the need to sometimes use a keyboard and mouse. In terms of a UI, in many ways Android is a step backwards, and so was iOS. That's why Windows 10 is a bit intriguing to me, and I can see the real utility in the hybrid tablet/laptops like the Surface Pro is. I've actually seen a lot of surface pros lately being used professionally.
Surface Pro is nearly a complete laptop, just more expensive. It attacks the Apple Air, not the IPad.
Back on PowerShell, the other day I wanted to list all the UWP apps installed on my windows 10 box, which I can do with a simple PowerShell command. But the output was way too verbose, so I naturally wanted to reach for grep to find the relevant lines. I did some searching and found what I thought is a grep-like PS command, but I never got it to work.
I use cmd.exe for everything, in combination with mingw and cygwin utils. Though I'm not really a shell or scripting in general person. I usually start moving scripts to normal (console) software if they get more involved than a couple of commands and simple parametrisation.

I had a spell of unixy minimalism around 2000, using cmdline and filters etc, but I grew up :-)
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Windows cmd.exe to be deposed by PowerShell

Post by caseih »

marcov wrote:Surface Pro is nearly a complete laptop, just more expensive. It attacks the Apple Air, not the IPad.
Yes it is, but the people I've seen using them are using them almost exclusively in tablet mode. They see it as a Tablet that can run full MS Excel. And they use the onscreen keyboard too, leaving the actual keyboard tucked away. It's quite convenient when your office is a pickup truck. And they have me sign documents using a stylus (how's that for modern. ;).
I use cmd.exe for everything, in combination with mingw and cygwin utils. Though I'm not really a shell or scripting in general person. I usually start moving scripts to normal (console) software if they get more involved than a couple of commands and simple parametrisation.

I had a spell of unixy minimalism around 2000, using cmdline and filters etc, but I grew up :-)
I've done a lot of shell scripting in my day, and for a lot of things banging out a bash script is quick and easy, and often astounds my windows-using friends and coworkers how quickly you can put things together with pipes and filters. If the script is longer than about a page, I tend to push it into Python. Nothing's worse than a huge, complicated bash script (well, maybe a huge, complicated perl script). In Windows I tend to hang out in the cygwin bash shell. cmd.exe is a bit too limited for my tastes, and I use unixy-minimalist filters like grep, cut, sed on a daily basis.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Windows cmd.exe to be deposed by PowerShell

Post by marcov »

caseih wrote:
marcov wrote:Surface Pro is nearly a complete laptop, just more expensive. It attacks the Apple Air, not the IPad.
Yes it is, but the people I've seen using them are using them almost exclusively in tablet mode.
So basic tablet tasks and maybe Excel. That would have been my bet too(based on a handful sightings in a train, mostly by business types in the first class).

We'll see if the formfactor survives. The price is there not a problem, since anything snazzy (like mentioned Apple air) is horrendously expensive.

The pricepoint does preclude it from breaking out of that niche though, and is not really an UWP platform accelerator as the only non win32 tool is Excel.
I've done a lot of shell scripting in my day, and for a lot of things banging out a bash script is quick and easy, and often astounds my windows-using friends and coworkers how quickly you can put things together with pipes and filters.
I still use them on the cmdline for one off filter and search jobs things. But I don't really write scripts as in more than a handful lines. The only exception are a few parameterized FPC build scripts.
If the script is longer than about a page, I tend to push it into Python. Nothing's worse than a huge, complicated bash script (well, maybe a huge, complicated perl script). In Windows I tend to hang out in the cygwin bash shell. cmd.exe is a bit too limited for my tastes, and I use unixy-minimalist filters like grep, cut, sed on a daily basis.
I never got the use of Python and didn't like the unnative feel on my majority target Windows. (most of such scripting is for work) So I usually directly set it up in Delphi or FPC. The arrival of a multitude of generic map and list types helped that tremendously.
FreeFox
Posts: 69
Joined: Sep 28, 2016 23:45

Re: Windows cmd.exe to be deposed by PowerShell

Post by FreeFox »

MS have now confirmed that (thankfully) Windows 10 will continue to support cmd.exe even though the default shell will be PowerShell in future:

http://www.computerworld.com/article/31 ... r-all.html
Post Reply