Split string to characters

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Posts: 6
Joined: 13 Nov 2019 08:35

Re: Split string to characters

#31 Post by BatchGuy » 10 Dec 2019 16:31

The error message flashing by when my batch crashed, is indeed sth. like "( was unexpected at this time."
Which I couldn't figure out at all until now, thx to your highly appreciated clarification.
And sort of confirms that the weird cmd.exe design --- if any --- is really rocket science! :?


Posts: 3815
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Split string to characters

#32 Post by aGerman » 11 Dec 2019 12:00

BatchGuy wrote:
10 Dec 2019 16:31
And sort of confirms that the weird cmd.exe design --- if any --- is really rocket science! :?
The CMD is buggy as hell and Microsoft is absolutely aware of that. When I called it an "evil beast", Michael Niksa (one of the Console/Terminal core developers) agreed with me :D
However, the decision of Microsoft is to avoid any updates of cmd.exe. The official reason is that they are afraid to "break the world" as soon as they change the current behavior of the CMD. And I tend to agrre with them. If you look around in this forum you will realize that we all try hard to take advantage of any bug and every undefined behavior of cmd.exe and the Windows command line tools. Microsoft argues that they would get loads of complaints if undocumented "features" disappear with an update people have been used to for decades. But in my opinion there is another reason. They're trying to get us to use PowerShell instead of CMD. They already made it the default shell on Win 10. And again I tend to agree with their decision (even if it may sound odd from a moderator in a Batch forum). PowerShell enables you to get access to any possibility of .NET, including graphical interfaces and the invocation of Windows API functions. However, Microsoft promises to continue shipping the CMD along with future Windows versions. People who like Batch don't have to worry. But I'm convinced that it will lose importance over time...


Post Reply