Crappy parser is craaaappy

Just when I was starting to actually enjoy (read: thinking “hey, it’s not so bad!”) Windows scripting after discovering documentation for the 32 bits command interpreter in Windows NT, I realize I have been spoiled by Unix shells and expect some things to work, and then frown in disgust when they don’t.


for /F "usebackq tokens=2,*" %i in (`net use | find "..."`)... 
| was unexpected

I really wanted to like writing cmd scripts. But the parser is way too obnoxious when parsing brackets. For instance, you can’t set an environement variable in one branch of a conditional statement.


if "text" EQU "othertext" ( 
    set VAR=value 
) else ( 
    echo Not Working. 
)

This will fail silently or with unexpected results. Can’t wait until PowerShell becomes mainstream enough for me to use.

You might also enjoy:

About Alexandre Gauthier

A freelance network guy, sometimes programmer and overall tinkerer. Said to be a decent writer, in both english and en français. Wears fancy pants with torn t-shirts on sundays. Enjoys writing long, vitriolic diatribes and short stories. Lives inside a unix shell, favorite text editor is vim.
This entry was posted in Computers, English, Programming, Randomness, Vitriolic Diatribes, Windows and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">