Talk:Windows Batch Scripting

Reorganising this page
This is a very long page, I would rather have it in separate pages. I am going ahead and doing this. Wish me luck. --Grich 02:05, 23 March 2007 (UTC)

I think think this page needs splitting up but to turn it into something other than a reiteration of "documentation" elsewhere I think it should be split it categories with good examples. The sections would something such as File Management, Control Flow, Presentation etc. I think more content should be added before doing this split. --Jason Cozens 17:38, 6 December 2008 (UTC)

I have now added new chapters for this book. I haven't started editing (deleting or moving content) from the main page as I will do this as the chapters build up. The intention is to make the main page into an overview and add an introductory chapter (Chapter 1.). --Jason Cozens 20:55, 30 December 2008 (UTC)

Question
NEWB says: Why doesn't recognize a file like file 1.doc I typed in the right path ,and start file 1.doc but it won't load the doc.


 * The reason is because batch files treat spaces as a new command. If you want to run file 1.doc, you must type  START file_1.doc with the underscore. --[[user:penubag|penubag ]]''' ([[w:user talk:penubag|talk ]]; [[w:user:penubag|w ]]) 05:58, 17 July 2008 (UTC)


 * @NEWB, penubag is wrong. I have never seen ANY version of the Windows START command use an underscore to replace a space.
 * Instead, simply surround the file-name with quotes like so:
 * Actually, you don't even need the START command, you can launch the document by simply typing the name and extention inside a set of double quotes. Like this:
 * - BB -- BinaryBunny (discuss • contribs) 23:34, 31 May 2012 (UTC)
 * - BB -- BinaryBunny (discuss • contribs) 23:34, 31 May 2012 (UTC)
 * - BB -- BinaryBunny (discuss • contribs) 23:34, 31 May 2012 (UTC)

Add CMD to list of Commands - Commands to be covered.
Is it OK to add CMD into the list of commands between  and  ? --Jason Cozens 09:00, 07 November 2008 (UTC)

I've seen that CMD is listed under external commands. Does there still want to be an entry in the main list of commands as for cmd.exe CMD comes up in the >HELP list. --Jason Cozens 11:35, 11 November 2008 (UTC)

In order to make the initial version of this book tractable I'd like to concentrate on one set of commands and then add notes about other command interpreters later. I propose to start by covering the commands in Windows XP cmd.exe Version 5.1.2600 to start with. --Jason Cozens 20:58, 30 December 2008 (UTC)

Split This Book
This book definitely needs to be split into different sections.

Specifically this (no longer current) book needs to be dedicated to Windows built in Command Interpreter (as of Windos NT 4.0) CMD.EXE.

The other command interpreters central to this book (4NT [from JP Software] and CMD [from ReactOS]) should only be mentioned as add-ons or potential replacements for Microsoft's CMD.EXE.

Currently the verbiage used to identify which of the 3 is being referred to is haphazard. Additionally, CMD and ReactOS are used interchangeably, potentially confusing readers (like me) into thinking that MS CMD.EXE commands are being described when it's really ReactOS commands.

Also notations about which commands were new, available, changed, disappeared and reappeared through the different versions of Windows should be added. Possibly it might be wise to create separate books for DOS, Windows 9x, ME, NT, 2000, XP, Vista, 7, and 8.

In fact, I don't know why other Command Interpreters like FreeDOS and 4DOS should not also be mentioned, and given their own books.

Lastly, I believe that some of the explanations of the commands are FAR to in-depth, and would be more appropriately located on a Wikipedia page of their own. This book  should  be more than just a list of commands, but I think a short explanation of the command, maybe simple examples of each 'Mode' of use. (Take the NET and FOR commands for example. FOR could include an example of "for %%x (*.*) do", "for /f", "for /i", etc. But leave the page after page in-depth explanations of each command on *pedia. IMHO. Or at least until we have a better table of contents and overview of commands. Again, IMHO.

- BB -- BinaryBunny (discuss • contribs) 22:23, 31 May 2012 (UTC)

Scope restriction
I have restricted the book to cmd.exe, as proposed at above on this talk page. Instead of planning to treat three separate command interpreters while treating none of them in any depth, the book should better focus on the most popular and most used command-line interpreter for MS Windows.

Here is my scope-restricting edit.

Furthermore, I have removed any links to the following stubby subpages: --Dan Polansky (discuss • contribs) 12:05, 25 August 2012 (UTC)
 * /Batch File Scripting
 * /Environment Commands
 * /File and Directory Management
 * /File Commands
 * /Interactive Commands
 * /Tips and Tricks

Book title
I have renamed the book from "Guide to Windows Commands" to "Windows Batch Scripting". The book explains not only the commands of cmd.exe but also its other features such as environment variables, pipes, redirection, command-line arguments and the like. An alternative title I have considered in "Windows Batch Programming". --Dan Polansky (discuss • contribs) 15:04, 25 August 2012 (UTC)

Breaking into subpages
I object to breaking this book into subpages. --Dan Polansky (discuss • contribs) 10:19, 23 June 2013 (UTC)
 * Good for you! But please stop spamming the comment section! Without any reasoning this comment is rather pointless, so I would very much like to ask you at least to add a list of advantages regarding your choice. Thanks! --Albin77 (discuss • contribs) 07:54, 24 June 2013 (UTC)
 * Addition: especially since the same topic has already been started twice!! Please move your comment to the appropriate discussion or remove it altogether! Thank you! --Albin77 (discuss • contribs) 12:22, 26 June 2013 (UTC)
 * I ask you to leave "Breaking into subpages" thread alone. The subject heading captures the subject poorly, as does . --Dan Polansky (discuss • contribs) 16:50, 26 June 2013 (UTC)
 * Advantages of a single page, for you:
 * Easier search using browser's Control + F function
 * No need to create and update a printed version page
 * Snapshotting of book development: a revision of a single page is a snapshot of a book in time. Creating a snapshot in time of a collection of pages is far from that straightforward.
 * Advantages of multiple pages:
 * Smaller occupation of wiki database storage, as edits are made to much smaller pages
 * Better focus for readers with attention deficit
 * Shorter loading times, but not much really, I think. Depends on the length of a book. For a book under 100 KB, the loading time difference seems negligible. --Dan Polansky (discuss • contribs) 06:48, 13 July 2013 (UTC)
 * Thanks! Control + F is a good argument, although wikipedia has a funktion to search within multipaged books. I suppose thats a personal choice. Not sure, why you would want to read an "old version" of the book, but that's true, a single page would make that easier.
 * For now I would agree with you and stick to the single page version as long as possible as well (and since we are the only ones who care... ;) Although I don't agree with starting the third thread about "spliting the book" (in addition to and and . This makes a discussion quite hard! So I would either suggest we merge them or just delete the two old once (since they only have suggestions on how to do the split and weren't used for the past few years). Cheers! --85.177.167.42 (discuss) 09:39, 13 July 2013 (UTC) --Albin77 (discuss • contribs) 09:41, 13 July 2013 (UTC)
 * It is not your business to manage discussions, deleting them or moving them. You are a non-contributor to English Wikibooks. Even actual content contributors do not run around Wikibooks deleting and moving discussions. I do not really want to discuss with you; I want to discuss with people with track record of actual delivery of results. --Dan Polansky (discuss • contribs) 10:00, 13 July 2013 (UTC)
 * (Years later) To track arguments in one place, I created Should all books in Wikibooks have subpages for chapters?. --Dan Polansky (discuss • contribs) 12:15, 3 March 2024 (UTC)

Some errors/inconsistencies
It is stated under "Quoting and escaping" that "The percent sign (%) is a special case. On the command line, it does not need quoting or escaping.". This is not true, it does need to be escaped in some cases, as demonstrated by one of the examples: "echo %temp%", which does NOT print "%temp%" but the name of a temp directory.
 * Thanks. Is the correction I made in correct? --Dan Polansky (discuss • contribs) 10:53, 10 January 2016 (UTC)

Registry not covered
MS-DOS Batch script is capable of modifying the windows registry via the REQ QUERY,REG ADD, REG DEL and the REG COPY commands. If you need a source to add registry modification to the book you can find a source for it at the tutorialspoint tutorial it discusses registry modification.
 * Thanks. JackPotte (discuss • contribs) 06:52, 6 October 2016 (UTC)
 * Stub for REG added. --Dan Polansky (discuss • contribs) 15:35, 5 November 2016 (UTC)

Query : change?
Section "Variable substitution" includes, starting the second list element, "For variable specifications that name batch file parameters (i.e. that are non-negative decimal numbers) ... ".

Perhaps "non-negative decimal numbers" should be "a single decimal digit"? 94.30.84.71 (discuss) 19:53, 1 January 2017 (UTC)
 * I rewrote "Variable substitution" section to be simpler and clearer, showing things as far as possible instead of describing them. I hope you'll like the change. --Dan Polansky (discuss • contribs) 10:32, 25 February 2017 (UTC)

Reader statistics
As per pageviews.wmcloud.org: The raw data of page view per month: 2015-07: 20259; 2015-08: 19837; 2015-09: 20619; 2015-10: 20475; 2015-11: 21260; 2015-12: 20441; 2016-01: 22400; 2016-02: 23546; 2016-03: 23648; 2016-04: 22979; 2016-05: 24066; 2016-06: 26563; 2016-07: 26298; 2016-08: 27204; 2016-09: 22376; 2016-10: 20523; 2016-11: 19732; 2016-12: 16603; 2017-01: 18046; 2017-02: 18510; 2017-03: 19360; 2017-04: 17608; 2017-05: 17415; 2017-06: 18522; 2017-07: 16437; 2017-08: 16397; 2017-09: 16164; 2017-10: 16908; 2017-11: 16934; 2017-12: 15032; 2018-01: 19081; 2018-02: 20294; 2018-03: 23204; 2018-04: 21549; 2018-05: 22795; 2018-06: 21517; 2018-07: 22298; 2018-08: 24856; 2018-09: 22557; 2018-10: 20418; 2018-11: 18635; 2018-12: 15912; 2019-01: 18298; 2019-02: 18072; 2019-03: 15722; 2019-04: 14494; 2019-05: 15170; 2019-06: 14804; 2019-07: 14993; 2019-08: 15294; 2019-09: 15466; 2019-10: 17373; 2019-11: 16836; 2019-12: 14185; 2020-01: 14587; 2020-02: 13522; 2020-03: 11609; 2020-04: 12506; 2020-05: 11771; 2020-06: 11186; 2020-07: 10723; 2020-08: 9042; 2020-09: 10320; 2020-10: 10240; 2020-11: 10784; 2020-12: 10796; 2021-01: 11283; 2021-02: 11165; 2021-03: 11209; 2021-04: 9429; 2021-05: 8426; 2021-06: 7239; 2021-07: 8497; 2021-08: 8027; 2021-09: 8130; 2021-10: 8092; 2021-11: 6862; 2021-12: 6914; 2022-01: 6484; 2022-02: 6548; 2022-03: 8495; 2022-04: 6712; 2022-05: 6403; 2022-06: 6688; 2022-07: 6741; 2022-08: 6627; 2022-09: 6864; 2022-10: 7029; 2022-11: 7371; 2022-12: 7234; 2023-01: 8185; 2023-02: 8008; 2023-03: 9078; 2023-04: 6568.
 * From mid 2015 to mid 2016, the monthly page views were nearly always over 20,000.
 * From mid 2016 to Dec 2019, the monthly page views were nearly always over 15,000.
 * From Jan 2020, it trended downward and stabilized, in 2021 through 2023, above 6,500.

--Dan Polansky (discuss • contribs) 11:23, 2 June 2023 (UTC)