anchor.diff:  set "EXEC="
   set "IF_NOEXEC=if defined EXEC"
   set "SET=call :EchoAndSet"	&:# Command used in the end to set the environment variable
  +set "CAPTURE=:CaptureAll"
   :next_arg
   %POPARG%
   if "%ARG%"=="--" %POPARG% & goto :start &:# Allows defining a -X variable, etc
   if "%ARG%"=="-?" goto :help
   if "%ARG%"=="/?" goto :help
  +if "%ARG%"=="-l" set "CAPTURE=:CaptureLast" & goto :next_arg
   if "%ARG%"=="-q" set "DO=do" & goto :next_arg
   if "%ARG%"=="-X" set "EXEC=echo" & set "SET=set" & goto :next_arg
   
  
positive.code: 
  :#############################################################################:
  End of the JScript comment around the Batch section; Beginning of the JScript section */
  
  /* Process JScript command-line arguments */
  function main(argc, argv) {
    var keys = "";
    for (var i = 1; i < argc; i++) {
      var arg = argv[i];
      // WScript.Echo("JScript args[" + i + "] = " + arg);
      /* Escape the reserved characters for use by SendKeys */
      if (keys != "") keys += " ";
      for (var j = 0; j < arg.length; j++) {
        var c = arg.charAt(j);
        switch (c) {
        case '+':
        case '~':
        case '(':
        case ')':
        case '{':
        case '}':
  	c = "{" + c + "}";
  	break;
        case '^':
        case '%':
  	c = "{" + c + "}";
  	c = c + c;
  	break;
        }
        keys += c;
      }
    }
    var shell = WScript.CreateObject("WScript.Shell");
    shell.SendKeys("set " + keys + "{ENTER}");
  }
  
  /* Top level code, building a C-like environment */
  
negative.code: set CMDLINE=%ARGS%
  if defined CMDLINE (
    call :Entities.decode ARGS CMDLINE
    set CMDLINE=%CMDLINE%^^^| findstr /R "^."
    set "SENDKEYS="
  ) else ( :# No command. Get the input from standard input.
    set CMDLINE=findstr /R "^."
    if "%CAPTURE%"==":CaptureLast" set SET=CScript //nologo //E:JScript "%SFULL%"
    set "SENDKEYS=%EXEC% CScript //nologo //E:JScript "%SFULL%" -s %VAR% RESULT"
  )
  :# %IF_NOEXEC% set CMDLINE
  :# In no-exec mode, correct the # of ^ so that the ^| displays right
  %IF_NOEXEC% set CMDLINE=%CMDLINE: ^| = ^^^^^^^| %
  
  goto %CAPTURE%
  
  :# Capture all output lines, quoting those with spaces or special characters
  :CaptureAll
  setlocal EnableDelayedExpansion
  set "RESULT="
  %EXEC% for /f "delims=" %%s in ('%CMDLINE%') do call :lappend RESULT "%%~s"
  
  :# NOTE: The findstr CMDLINE, used by default above, works for capturing stdin.
  :# What does not work is the export of the variable to the parent cmd.exe using pure batch.
  