• child process exited abnormally when issue any command on windows

    From Alex (Oleksandr) Malyushytskyy@21:1/5 to All on Wed Sep 29 15:12:07 2021
    Hi,

    tcl8.6.11
    Windows 10,
    After issue any command I get child process exited abnormally message.
    example is help.; It looks like command is executed though.
    Under Linux this is not an issue,


    Any clue how to fix it?

    Best regards ,

    AAlex

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Thu Sep 30 10:53:59 2021
    * "Alex (Oleksandr) Malyushytskyy" <alex@flex-logix.com>
    | After issue any command I get child process exited abnormally message.
    | example is help.; It looks like command is executed though.
    | Under Linux this is not an issue,

    Always show a full *TCL* code example (copy/paste from your input
    prompt), otherwise it is guesswork on the readers side what you exactly do.

    The typical pitfall with 'exec' is the command doing output to stderr,
    which is treated as an error by TCL.

    E.g. echo to stdout (catch returns 0):

    $ tclsh
    % catch {exec sh -c {echo this goes to stdout}} msg
    0
    % set msg
    this goes to stdout

    Whereas any output to stderr is treated as an error (catch returns 1):

    % catch {exec sh -c {echo this goes to stderr >&2}} msg
    1
    % set msg
    this goes to stderr
    % set errorCode
    NONE

    As you can see, the errorCode variable is NONE.

    Whereas if an exit code other than 0 occured, it is set to a list
    describing the problem:

    % catch {exec sh -c {exit 1}} msg
    1
    % set msg
    child process exited abnormally
    % set errorCode
    CHILDSTATUS 7188 1
    (for details see https://www.tcl.tk/man/tcl/TclCmd/tclvars.html#M12)

    Thus you probably can tell a 'real' error by the contents of 'errorCode'
    after exec fails.

    HTH
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alex (Oleksandr) Malyushytskyy@21:1/5 to Ralf Fassel on Thu Sep 30 07:50:08 2021
    On Thursday, September 30, 2021 at 1:54:03 AM UTC-7, Ralf Fassel wrote:
    * "Alex (Oleksandr) Malyushytskyy" <al...@flex-logix.com>
    | After issue any command I get child process exited abnormally message.
    | example is help.; It looks like command is executed though.
    | Under Linux this is not an issue,
    Always show a full *TCL* code example (copy/paste from your input
    prompt), otherwise it is guesswork on the readers side what you exactly do.

    The typical pitfall with 'exec' is the command doing output to stderr,
    which is treated as an error by TCL.

    E.g. echo to stdout (catch returns 0):

    $ tclsh
    % catch {exec sh -c {echo this goes to stdout}} msg
    0
    % set msg
    this goes to stdout

    Whereas any output to stderr is treated as an error (catch returns 1):

    % catch {exec sh -c {echo this goes to stderr >&2}} msg
    1
    % set msg
    this goes to stderr
    % set errorCode
    NONE

    As you can see, the errorCode variable is NONE.

    Whereas if an exit code other than 0 occured, it is set to a list
    describing the problem:

    % catch {exec sh -c {exit 1}} msg
    1
    % set msg
    child process exited abnormally
    % set errorCode
    CHILDSTATUS 7188 1
    (for details see https://www.tcl.tk/man/tcl/TclCmd/tclvars.html#M12)

    Thus you probably can tell a 'real' error by the contents of 'errorCode' after exec fails.

    HTH
    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alex (Oleksandr) Malyushytskyy@21:1/5 to Ralf Fassel on Thu Sep 30 07:57:12 2021
    On Thursday, September 30, 2021 at 1:54:03 AM UTC-7, Ralf Fassel wrote:
    * "Alex (Oleksandr) Malyushytskyy" <al...@flex-logix.com>
    | After issue any command I get child process exited abnormally message.
    | example is help.; It looks like command is executed though.
    | Under Linux this is not an issue,
    Always show a full *TCL* code example (copy/paste from your input
    prompt), otherwise it is guesswork on the readers side what you exactly do.

    The typical pitfall with 'exec' is the command doing output to stderr,
    which is treated as an error by TCL.

    E.g. echo to stdout (catch returns 0):

    $ tclsh
    % catch {exec sh -c {echo this goes to stdout}} msg
    0
    % set msg
    this goes to stdout

    Whereas any output to stderr is treated as an error (catch returns 1):

    % catch {exec sh -c {echo this goes to stderr >&2}} msg
    1
    % set msg
    this goes to stderr
    % set errorCode
    NONE

    As you can see, the errorCode variable is NONE.

    Whereas if an exit code other than 0 occured, it is set to a list
    describing the problem:

    % catch {exec sh -c {exit 1}} msg
    1
    % set msg
    child process exited abnormally
    % set errorCode
    CHILDSTATUS 7188 1
    (for details see https://www.tcl.tk/man/tcl/TclCmd/tclvars.html#M12)

    Thus you probably can tell a 'real' error by the contents of 'errorCode' after exec fails.

    HTH
    R'


    Ralf,

    Thanks for response. But I did not do any code modification.
    Error occurs in tclsh.exe.
    Here is the full input/output. I do not see any error code.


    % help
    For more information on a specific command, type HELP command-name
    ASSOC Displays or modifies file extension associations.
    ATTRIB Displays or changes file attributes.
    BREAK Sets or clears extended CTRL+C checking.
    BCDEDIT Sets properties in boot database to control boot loading.
    CACLS Displays or modifies access control lists (ACLs) of files.
    CALL Calls one batch program from another.
    CD Displays the name of or changes the current directory.
    CHCP Displays or sets the active code page number.
    CHDIR Displays the name of or changes the current directory.
    CHKDSK Checks a disk and displays a status report.
    CHKNTFS Displays or modifies the checking of disk at boot time.
    CLS Clears the screen.
    CMD Starts a new instance of the Windows command interpreter.
    COLOR Sets the default console foreground and background colors.
    COMP Compares the contents of two files or sets of files.
    COMPACT Displays or alters the compression of files on NTFS partitions. CONVERT Converts FAT volumes to NTFS. You cannot convert the
    current drive.
    COPY Copies one or more files to another location.
    DATE Displays or sets the date.
    DEL Deletes one or more files.
    DIR Displays a list of files and subdirectories in a directory. DISKPART Displays or configures Disk Partition properties.
    DOSKEY Edits command lines, recalls Windows commands, and
    creates macros.
    DRIVERQUERY Displays current device driver status and properties.
    ECHO Displays messages, or turns command echoing on or off.
    ENDLOCAL Ends localization of environment changes in a batch file.
    ERASE Deletes one or more files.
    EXIT Quits the CMD.EXE program (command interpreter).
    FC Compares two files or sets of files, and displays the
    differences between them.
    FIND Searches for a text string in a file or files.
    FINDSTR Searches for strings in files.
    FOR Runs a specified command for each file in a set of files.
    FORMAT Formats a disk for use with Windows.
    FSUTIL Displays or configures the file system properties.
    FTYPE Displays or modifies file types used in file extension
    associations.
    GOTO Directs the Windows command interpreter to a labeled line in
    a batch program.
    GPRESULT Displays Group Policy information for machine or user.
    GRAFTABL Enables Windows to display an extended character set in
    graphics mode.
    HELP Provides Help information for Windows commands.
    ICACLS Display, modify, backup, or restore ACLs for files and
    directories.
    IF Performs conditional processing in batch programs.
    LABEL Creates, changes, or deletes the volume label of a disk.
    MD Creates a directory.
    MKDIR Creates a directory.
    MKLINK Creates Symbolic Links and Hard Links
    MODE Configures a system device.
    MORE Displays output one screen at a time.
    MOVE Moves one or more files from one directory to another
    directory.
    OPENFILES Displays files opened by remote users for a file share.
    PATH Displays or sets a search path for executable files.
    PAUSE Suspends processing of a batch file and displays a message.
    POPD Restores the previous value of the current directory saved by
    PUSHD.
    PRINT Prints a text file.
    PROMPT Changes the Windows command prompt.
    PUSHD Saves the current directory then changes it.
    RD Removes a directory.
    RECOVER Recovers readable information from a bad or defective disk.
    REM Records comments (remarks) in batch files or CONFIG.SYS.
    REN Renames a file or files.
    RENAME Renames a file or files.
    REPLACE Replaces files.
    RMDIR Removes a directory.
    ROBOCOPY Advanced utility to copy files and directory trees
    SET Displays, sets, or removes Windows environment variables. SETLOCAL Begins localization of environment changes in a batch file.
    SC Displays or configures services (background processes).
    SCHTASKS Schedules commands and programs to run on a computer.
    SHIFT Shifts the position of replaceable parameters in batch files. SHUTDOWN Allows proper local or remote shutdown of machine.
    SORT Sorts input.
    START Starts a separate window to run a specified program or command. SUBST Associates a path with a drive letter.
    SYSTEMINFO Displays machine specific properties and configuration.
    TASKLIST Displays all currently running tasks including services. TASKKILL Kill or stop a running process or application.
    TIME Displays or sets the system time.
    TITLE Sets the window title for a CMD.EXE session.
    TREE Graphically displays the directory structure of a drive or
    path.
    TYPE Displays the contents of a text file.
    VER Displays the Windows version.
    VERIFY Tells Windows whether to verify that your files are written
    correctly to a disk.
    VOL Displays a disk volume label and serial number.
    XCOPY Copies files and directory trees.
    WMIC Displays WMI information inside interactive command shell.

    For more information on tools see the command-line reference in the online help.
    child process exited abnormally
    %

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alex (Oleksandr) Malyushytskyy@21:1/5 to All on Thu Sep 30 09:51:21 2021
    On Thursday, September 30, 2021 at 7:57:15 AM UTC-7, Alex (Oleksandr) Malyushytskyy wrote:

    Sorry for the noise, I am just starting using tcl,
    I am under windows so sh is not available
    Here is output with full input for help command.
    It looks like there is a problem with child process even though command is executed

    Best regards,
    Alex

    % catch { exec help } msg
    1
    % puts $errorInfo
    For more information on a specific command, type HELP command-name
    ASSOC Displays or modifies file extension associations.
    ATTRIB Displays or changes file attributes.
    BREAK Sets or clears extended CTRL+C checking.
    BCDEDIT Sets properties in boot database to control boot loading.
    CACLS Displays or modifies access control lists (ACLs) of files.
    CALL Calls one batch program from another.
    CD Displays the name of or changes the current directory.
    CHCP Displays or sets the active code page number.
    CHDIR Displays the name of or changes the current directory.
    CHKDSK Checks a disk and displays a status report.
    CHKNTFS Displays or modifies the checking of disk at boot time.
    CLS Clears the screen.
    CMD Starts a new instance of the Windows command interpreter.
    COLOR Sets the default console foreground and background colors.
    COMP Compares the contents of two files or sets of files.
    COMPACT Displays or alters the compression of files on NTFS partitions. CONVERT Converts FAT volumes to NTFS. You cannot convert the
    current drive.
    COPY Copies one or more files to another location.
    DATE Displays or sets the date.
    DEL Deletes one or more files.
    DIR Displays a list of files and subdirectories in a directory. DISKPART Displays or configures Disk Partition properties.
    DOSKEY Edits command lines, recalls Windows commands, and
    creates macros.
    DRIVERQUERY Displays current device driver status and properties.
    ECHO Displays messages, or turns command echoing on or off.
    ENDLOCAL Ends localization of environment changes in a batch file.
    ERASE Deletes one or more files.
    EXIT Quits the CMD.EXE program (command interpreter).
    FC Compares two files or sets of files, and displays the
    differences between them.
    FIND Searches for a text string in a file or files.
    FINDSTR Searches for strings in files.
    FOR Runs a specified command for each file in a set of files.
    FORMAT Formats a disk for use with Windows.
    FSUTIL Displays or configures the file system properties.
    FTYPE Displays or modifies file types used in file extension
    associations.
    GOTO Directs the Windows command interpreter to a labeled line in
    a batch program.
    GPRESULT Displays Group Policy information for machine or user.
    GRAFTABL Enables Windows to display an extended character set in
    graphics mode.
    HELP Provides Help information for Windows commands.
    ICACLS Display, modify, backup, or restore ACLs for files and
    directories.
    IF Performs conditional processing in batch programs.
    LABEL Creates, changes, or deletes the volume label of a disk.
    MD Creates a directory.
    MKDIR Creates a directory.
    MKLINK Creates Symbolic Links and Hard Links
    MODE Configures a system device.
    MORE Displays output one screen at a time.
    MOVE Moves one or more files from one directory to another
    directory.
    OPENFILES Displays files opened by remote users for a file share.
    PATH Displays or sets a search path for executable files.
    PAUSE Suspends processing of a batch file and displays a message.
    POPD Restores the previous value of the current directory saved by
    PUSHD.
    PRINT Prints a text file.
    PROMPT Changes the Windows command prompt.
    PUSHD Saves the current directory then changes it.
    RD Removes a directory.
    RECOVER Recovers readable information from a bad or defective disk.
    REM Records comments (remarks) in batch files or CONFIG.SYS.
    REN Renames a file or files.
    RENAME Renames a file or files.
    REPLACE Replaces files.
    RMDIR Removes a directory.
    ROBOCOPY Advanced utility to copy files and directory trees
    SET Displays, sets, or removes Windows environment variables. SETLOCAL Begins localization of environment changes in a batch file.
    SC Displays or configures services (background processes).
    SCHTASKS Schedules commands and programs to run on a computer.
    SHIFT Shifts the position of replaceable parameters in batch files. SHUTDOWN Allows proper local or remote shutdown of machine.
    SORT Sorts input.
    START Starts a separate window to run a specified program or command. SUBST Associates a path with a drive letter.
    SYSTEMINFO Displays machine specific properties and configuration.
    TASKLIST Displays all currently running tasks including services. TASKKILL Kill or stop a running process or application.
    TIME Displays or sets the system time.
    TITLE Sets the window title for a CMD.EXE session.
    TREE Graphically displays the directory structure of a drive or
    path.
    TYPE Displays the contents of a text file.
    VER Displays the Windows version.
    VERIFY Tells Windows whether to verify that your files are written
    correctly to a disk.
    VOL Displays a disk volume label and serial number.
    XCOPY Copies files and directory trees.
    WMIC Displays WMI information inside interactive command shell.

    For more information on tools see the command-line reference in the online help.
    child process exited abnormally
    while executing
    "exec help "
    % set errorCode
    CHILDSTATUS 19524 1
    %

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to Malyushytskyy" on Thu Sep 30 17:23:58 2021
    "Alex (Oleksandr) Malyushytskyy" <alex@flex-logix.com> wrote:
    On Thursday, September 30, 2021 at 7:57:15 AM UTC-7, Alex (Oleksandr) Malyushytskyy wrote:

    Sorry for the noise, I am just starting using tcl,
    I am under windows so sh is not available
    Here is output with full input for help command.
    It looks like there is a problem with child process even though command is executed

    Best regards,
    Alex

    % catch { exec help } msg
    1

    Then either cmd.exe's 'help' is returning an error code, or the "help"
    is output to the stderr channel.

    What happens if you change the command to?:

    catch {exec help 2> myfile.txt} msg

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alex (Oleksandr) Malyushytskyy@21:1/5 to All on Thu Sep 30 13:26:52 2021
    Then either cmd.exe's 'help' is returning an error code, or the "help"
    is output to the stderr channel.

    What happens if you change the command to?:

    catch {exec help 2> myfile.txt} msg

    % catch {exec help 2> myfile.txt} msg
    1
    % puts $errorInfo
    For more information on a specific command, type HELP command-name
    ASSOC Displays or modifies file extension associations.
    ATTRIB Displays or changes file attributes.
    BREAK Sets or clears extended CTRL+C checking.
    BCDEDIT Sets properties in boot database to control boot loading.
    CACLS Displays or modifies access control lists (ACLs) of files.
    CALL Calls one batch program from another.
    CD Displays the name of or changes the current directory.
    CHCP Displays or sets the active code page number.
    CHDIR Displays the name of or changes the current directory.
    CHKDSK Checks a disk and displays a status report.
    CHKNTFS Displays or modifies the checking of disk at boot time.
    CLS Clears the screen.
    CMD Starts a new instance of the Windows command interpreter.
    COLOR Sets the default console foreground and background colors.
    COMP Compares the contents of two files or sets of files.
    COMPACT Displays or alters the compression of files on NTFS partitions. CONVERT Converts FAT volumes to NTFS. You cannot convert the
    current drive.
    COPY Copies one or more files to another location.
    DATE Displays or sets the date.
    DEL Deletes one or more files.
    DIR Displays a list of files and subdirectories in a directory. DISKPART Displays or configures Disk Partition properties.
    DOSKEY Edits command lines, recalls Windows commands, and
    creates macros.
    DRIVERQUERY Displays current device driver status and properties.
    ECHO Displays messages, or turns command echoing on or off.
    ENDLOCAL Ends localization of environment changes in a batch file.
    ERASE Deletes one or more files.
    EXIT Quits the CMD.EXE program (command interpreter).
    FC Compares two files or sets of files, and displays the
    differences between them.
    FIND Searches for a text string in a file or files.
    FINDSTR Searches for strings in files.
    FOR Runs a specified command for each file in a set of files.
    FORMAT Formats a disk for use with Windows.
    FSUTIL Displays or configures the file system properties.
    FTYPE Displays or modifies file types used in file extension
    associations.
    GOTO Directs the Windows command interpreter to a labeled line in
    a batch program.
    GPRESULT Displays Group Policy information for machine or user.
    GRAFTABL Enables Windows to display an extended character set in
    graphics mode.
    HELP Provides Help information for Windows commands.
    ICACLS Display, modify, backup, or restore ACLs for files and
    directories.
    IF Performs conditional processing in batch programs.
    LABEL Creates, changes, or deletes the volume label of a disk.
    MD Creates a directory.
    MKDIR Creates a directory.
    MKLINK Creates Symbolic Links and Hard Links
    MODE Configures a system device.
    MORE Displays output one screen at a time.
    MOVE Moves one or more files from one directory to another
    directory.
    OPENFILES Displays files opened by remote users for a file share.
    PATH Displays or sets a search path for executable files.
    PAUSE Suspends processing of a batch file and displays a message.
    POPD Restores the previous value of the current directory saved by
    PUSHD.
    PRINT Prints a text file.
    PROMPT Changes the Windows command prompt.
    PUSHD Saves the current directory then changes it.
    RD Removes a directory.
    RECOVER Recovers readable information from a bad or defective disk.
    REM Records comments (remarks) in batch files or CONFIG.SYS.
    REN Renames a file or files.
    RENAME Renames a file or files.
    REPLACE Replaces files.
    RMDIR Removes a directory.
    ROBOCOPY Advanced utility to copy files and directory trees
    SET Displays, sets, or removes Windows environment variables. SETLOCAL Begins localization of environment changes in a batch file.
    SC Displays or configures services (background processes).
    SCHTASKS Schedules commands and programs to run on a computer.
    SHIFT Shifts the position of replaceable parameters in batch files. SHUTDOWN Allows proper local or remote shutdown of machine.
    SORT Sorts input.
    START Starts a separate window to run a specified program or command. SUBST Associates a path with a drive letter.
    SYSTEMINFO Displays machine specific properties and configuration.
    TASKLIST Displays all currently running tasks including services. TASKKILL Kill or stop a running process or application.
    TIME Displays or sets the system time.
    TITLE Sets the window title for a CMD.EXE session.
    TREE Graphically displays the directory structure of a drive or
    path.
    TYPE Displays the contents of a text file.
    VER Displays the Windows version.
    VERIFY Tells Windows whether to verify that your files are written
    correctly to a disk.
    VOL Displays a disk volume label and serial number.
    XCOPY Copies files and directory trees.
    WMIC Displays WMI information inside interactive command shell.

    For more information on tools see the command-line reference in the online help.
    child process exited abnormally
    while executing
    "exec help 2> myfile.txt"
    % set errorCode
    CHILDSTATUS 20112 1
    %

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Bezoar@21:1/5 to al...@flex-logix.com on Thu Sep 30 14:44:28 2021
    On Thursday, September 30, 2021 at 3:26:54 PM UTC-5, al...@flex-logix.com wrote:
    Then either cmd.exe's 'help' is returning an error code, or the "help"
    is output to the stderr channel.

    What happens if you change the command to?:

    catch {exec help 2> myfile.txt} msg
    % catch {exec help 2> myfile.txt} msg
    1
    % puts $errorInfo
    For more information on a specific command, type HELP command-name
    ASSOC Displays or modifies file extension associations.
    ATTRIB Displays or changes file attributes.
    BREAK Sets or clears extended CTRL+C checking.
    BCDEDIT Sets properties in boot database to control boot loading.
    CACLS Displays or modifies access control lists (ACLs) of files.
    CALL Calls one batch program from another.
    CD Displays the name of or changes the current directory.
    CHCP Displays or sets the active code page number.
    CHDIR Displays the name of or changes the current directory.
    CHKDSK Checks a disk and displays a status report.
    CHKNTFS Displays or modifies the checking of disk at boot time.
    CLS Clears the screen.
    CMD Starts a new instance of the Windows command interpreter.
    COLOR Sets the default console foreground and background colors.
    COMP Compares the contents of two files or sets of files.
    COMPACT Displays or alters the compression of files on NTFS partitions. CONVERT Converts FAT volumes to NTFS. You cannot convert the
    current drive.
    COPY Copies one or more files to another location.
    DATE Displays or sets the date.
    DEL Deletes one or more files.
    DIR Displays a list of files and subdirectories in a directory.
    DISKPART Displays or configures Disk Partition properties.
    DOSKEY Edits command lines, recalls Windows commands, and
    creates macros.
    DRIVERQUERY Displays current device driver status and properties.
    ECHO Displays messages, or turns command echoing on or off.
    ENDLOCAL Ends localization of environment changes in a batch file.
    ERASE Deletes one or more files.
    EXIT Quits the CMD.EXE program (command interpreter).
    FC Compares two files or sets of files, and displays the
    differences between them.
    FIND Searches for a text string in a file or files.
    FINDSTR Searches for strings in files.
    FOR Runs a specified command for each file in a set of files.
    FORMAT Formats a disk for use with Windows.
    FSUTIL Displays or configures the file system properties.
    FTYPE Displays or modifies file types used in file extension
    associations.
    GOTO Directs the Windows command interpreter to a labeled line in
    a batch program.
    GPRESULT Displays Group Policy information for machine or user.
    GRAFTABL Enables Windows to display an extended character set in
    graphics mode.
    HELP Provides Help information for Windows commands.
    ICACLS Display, modify, backup, or restore ACLs for files and
    directories.
    IF Performs conditional processing in batch programs.
    LABEL Creates, changes, or deletes the volume label of a disk.
    MD Creates a directory.
    MKDIR Creates a directory.
    MKLINK Creates Symbolic Links and Hard Links
    MODE Configures a system device.
    MORE Displays output one screen at a time.
    MOVE Moves one or more files from one directory to another
    directory.
    OPENFILES Displays files opened by remote users for a file share.
    PATH Displays or sets a search path for executable files.
    PAUSE Suspends processing of a batch file and displays a message.
    POPD Restores the previous value of the current directory saved by
    PUSHD.
    PRINT Prints a text file.
    PROMPT Changes the Windows command prompt.
    PUSHD Saves the current directory then changes it.
    RD Removes a directory.
    RECOVER Recovers readable information from a bad or defective disk.
    REM Records comments (remarks) in batch files or CONFIG.SYS.
    REN Renames a file or files.
    RENAME Renames a file or files.
    REPLACE Replaces files.
    RMDIR Removes a directory.
    ROBOCOPY Advanced utility to copy files and directory trees
    SET Displays, sets, or removes Windows environment variables.
    SETLOCAL Begins localization of environment changes in a batch file.
    SC Displays or configures services (background processes).
    SCHTASKS Schedules commands and programs to run on a computer.
    SHIFT Shifts the position of replaceable parameters in batch files.
    SHUTDOWN Allows proper local or remote shutdown of machine.
    SORT Sorts input.
    START Starts a separate window to run a specified program or command.
    SUBST Associates a path with a drive letter.
    SYSTEMINFO Displays machine specific properties and configuration.
    TASKLIST Displays all currently running tasks including services.
    TASKKILL Kill or stop a running process or application.
    TIME Displays or sets the system time.
    TITLE Sets the window title for a CMD.EXE session.
    TREE Graphically displays the directory structure of a drive or
    path.
    TYPE Displays the contents of a text file.
    VER Displays the Windows version.
    VERIFY Tells Windows whether to verify that your files are written
    correctly to a disk.
    VOL Displays a disk volume label and serial number.
    XCOPY Copies files and directory trees.
    WMIC Displays WMI information inside interactive command shell.

    For more information on tools see the command-line reference in the online help.
    child process exited abnormally
    while executing
    "exec help 2> myfile.txt"
    % set errorCode
    CHILDSTATUS 20112 1
    %
    if you run help in a windows then print out the error level you get 1 as the exit code. so tcl interpretes that as an error ( i.e. not 0 ). This is not a problem with
    tcl .
    help
    .....
    echo Exit Code is %errorlevel%
    Exit Code is 1



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alex (Oleksandr) Malyushytskyy@21:1/5 to Bezoar on Thu Sep 30 15:11:49 2021
    On Thursday, September 30, 2021 at 2:44:30 PM UTC-7, Bezoar wrote:
    On Thursday, September 30, 2021 at 3:26:54 PM UTC-5, al...@flex-logix.com wrote:
    Then either cmd.exe's 'help' is returning an error code, or the "help"
    is output to the stderr channel.

    What happens if you change the command to?:

    catch {exec help 2> myfile.txt} msg
    % catch {exec help 2> myfile.txt} msg
    1
    % puts $errorInfo
    For more information on a specific command, type HELP command-name
    ASSOC Displays or modifies file extension associations.
    ATTRIB Displays or changes file attributes.
    BREAK Sets or clears extended CTRL+C checking.
    BCDEDIT Sets properties in boot database to control boot loading.
    CACLS Displays or modifies access control lists (ACLs) of files.
    CALL Calls one batch program from another.
    CD Displays the name of or changes the current directory.
    CHCP Displays or sets the active code page number.
    CHDIR Displays the name of or changes the current directory.
    CHKDSK Checks a disk and displays a status report.
    CHKNTFS Displays or modifies the checking of disk at boot time.
    CLS Clears the screen.
    CMD Starts a new instance of the Windows command interpreter.
    COLOR Sets the default console foreground and background colors.
    COMP Compares the contents of two files or sets of files.
    COMPACT Displays or alters the compression of files on NTFS partitions. CONVERT Converts FAT volumes to NTFS. You cannot convert the
    current drive.
    COPY Copies one or more files to another location.
    DATE Displays or sets the date.
    DEL Deletes one or more files.
    DIR Displays a list of files and subdirectories in a directory.
    DISKPART Displays or configures Disk Partition properties.
    DOSKEY Edits command lines, recalls Windows commands, and
    creates macros.
    DRIVERQUERY Displays current device driver status and properties.
    ECHO Displays messages, or turns command echoing on or off.
    ENDLOCAL Ends localization of environment changes in a batch file.
    ERASE Deletes one or more files.
    EXIT Quits the CMD.EXE program (command interpreter).
    FC Compares two files or sets of files, and displays the
    differences between them.
    FIND Searches for a text string in a file or files.
    FINDSTR Searches for strings in files.
    FOR Runs a specified command for each file in a set of files.
    FORMAT Formats a disk for use with Windows.
    FSUTIL Displays or configures the file system properties.
    FTYPE Displays or modifies file types used in file extension
    associations.
    GOTO Directs the Windows command interpreter to a labeled line in
    a batch program.
    GPRESULT Displays Group Policy information for machine or user.
    GRAFTABL Enables Windows to display an extended character set in
    graphics mode.
    HELP Provides Help information for Windows commands.
    ICACLS Display, modify, backup, or restore ACLs for files and
    directories.
    IF Performs conditional processing in batch programs.
    LABEL Creates, changes, or deletes the volume label of a disk.
    MD Creates a directory.
    MKDIR Creates a directory.
    MKLINK Creates Symbolic Links and Hard Links
    MODE Configures a system device.
    MORE Displays output one screen at a time.
    MOVE Moves one or more files from one directory to another
    directory.
    OPENFILES Displays files opened by remote users for a file share.
    PATH Displays or sets a search path for executable files.
    PAUSE Suspends processing of a batch file and displays a message.
    POPD Restores the previous value of the current directory saved by
    PUSHD.
    PRINT Prints a text file.
    PROMPT Changes the Windows command prompt.
    PUSHD Saves the current directory then changes it.
    RD Removes a directory.
    RECOVER Recovers readable information from a bad or defective disk.
    REM Records comments (remarks) in batch files or CONFIG.SYS.
    REN Renames a file or files.
    RENAME Renames a file or files.
    REPLACE Replaces files.
    RMDIR Removes a directory.
    ROBOCOPY Advanced utility to copy files and directory trees
    SET Displays, sets, or removes Windows environment variables.
    SETLOCAL Begins localization of environment changes in a batch file.
    SC Displays or configures services (background processes).
    SCHTASKS Schedules commands and programs to run on a computer.
    SHIFT Shifts the position of replaceable parameters in batch files. SHUTDOWN Allows proper local or remote shutdown of machine.
    SORT Sorts input.
    START Starts a separate window to run a specified program or command.
    SUBST Associates a path with a drive letter.
    SYSTEMINFO Displays machine specific properties and configuration.
    TASKLIST Displays all currently running tasks including services.
    TASKKILL Kill or stop a running process or application.
    TIME Displays or sets the system time.
    TITLE Sets the window title for a CMD.EXE session.
    TREE Graphically displays the directory structure of a drive or
    path.
    TYPE Displays the contents of a text file.
    VER Displays the Windows version.
    VERIFY Tells Windows whether to verify that your files are written correctly to a disk.
    VOL Displays a disk volume label and serial number.
    XCOPY Copies files and directory trees.
    WMIC Displays WMI information inside interactive command shell.

    For more information on tools see the command-line reference in the online help.
    child process exited abnormally
    while executing
    "exec help 2> myfile.txt"
    % set errorCode
    CHILDSTATUS 20112 1
    %
    if you run help in a windows then print out the error level you get 1 as the exit code. so tcl interpretes that as an error ( i.e. not 0 ). This is not a problem with
    tcl .
    help
    .....
    echo Exit Code is %errorlevel%
    Exit Code is 1



    Thanks Bezoar,
    it looks like this is a case.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ralf Fassel@21:1/5 to All on Fri Oct 1 17:45:50 2021
    * Bezoar <cwjolly@gmail.com>
    | if you run help in a windows then print out the error level you get 1
    | as the exit code. so tcl interpretes that as an error ( i.e. not 0 ).
    | This is not a problem with tcl .
    | c:\> help
    | .....
    | c:\> echo Exit Code is %errorlevel%
    | Exit Code is 1

    | c:\>

    LOL, it's even worse:

    C:\Users\ralf>help foobar
    Zu diesem Befehl steht kein Hilfethema zur Verfügung.
    Versuchen Sie es mit "foobar /?".
    (i.e. "no help available for foobar")

    C:\Users\ralf>echo %errorlevel%
    0

    So 'help' reverses the usual scheme of "exit-code 0 is success, anything
    else is errorcode". Microsoft again...

    R'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Alex (Oleksandr) Malyushytskyy@21:1/5 to Ralf Fassel on Mon Oct 11 16:32:41 2021
    On Friday, October 1, 2021 at 8:45:54 AM UTC-7, Ralf Fassel wrote:
    * Bezoar <cwj...@gmail.com>
    | if you run help in a windows then print out the error level you get 1
    | as the exit code. so tcl interpretes that as an error ( i.e. not 0 ).
    | This is not a problem with tcl .
    | c:\> help
    | .....
    | c:\> echo Exit Code is %errorlevel%
    | Exit Code is 1

    | c:\>
    LOL, it's even worse:

    C:\Users\ralf>help foobar
    Zu diesem Befehl steht kein Hilfethema zur Verfügung.
    Versuchen Sie es mit "foobar /?".
    (i.e. "no help available for foobar")

    C:\Users\ralf>echo %errorlevel%
    0

    So 'help' reverses the usual scheme of "exit-code 0 is success, anything else is errorcode". Microsoft again...

    R'


    It looks like it is done on purpose:
    "The Windows Help program is not supported in Windows 10, Windows Server 2012 or later versions of Windows Server. The Windows Help program is available for Windows Vista, 7, 8 and 8.1 only.

    Microsoft strongly recommends that software developers discontinue using the Windows Help application. Software developers who ship programs that rely on .hlp files are encouraged to transition their Help experience to an alternative Help file format,
    such as CHM, HTML, or XML. For more information see the MSDN article Which Version of Help do I Need? While Microsoft develops future Help technologies, we encourage Help authors to continue using HTML Help 1.4. HTML Help 1.4 is included in Windows
    versions starting with Windows 7."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)