Best free resource for learning advanced batch-file usage?

后端 未结 6 1236
滥情空心
滥情空心 2020-12-05 06:00

What are the best free resources for learning advanced batch-file usage?

6条回答
  •  -上瘾入骨i
    2020-12-05 06:28

    It's not free, but it's probably the best. "Windows NT Shell Scripting" by Tim Hill.

    That said, whenever I try to do something 'advanced' in cmd batch files, I always end up regretting it.

    Always.

    edit: some explanation of the shortcomings of batch files:

    • math capabilities are pathetic
    • quoting support is an afterthought - if you need to pass a quoted string as an argument to a command that needs to be quoted itself, reserve a spot at the asylum (actually, I'm not sure it's possible)
    • string manipulation is a patchwork of half implemented functionality

    Then there are the seemingly never-ending bits of oddities, corner cases, and inconsistencies that you run into at every turn.

    The only thing going for batch files is that they're supported on every Windows box out there. If you just want to automate executing a few commands as a group, great. Maybe add a simple loop, a couple of subroutines, and some environment variables to parameterize things. Beyond that I strongly recommend you use something else.

提交回复
热议问题