link to issues.md - ncr33245/searchinfo.bat GitHub Wiki

Issues Report

Information Choice Batch Script

Description

The Information Choice Batch Script is designed to provide users with menu-driven options to retrieve system-related information. However, there are certain issues that need attention.

Issues

  1. Menu Redirection:

    • The script uses goto menu to redirect to the menu. However, this results in an infinite loop due to the absence of a proper exit condition.
  2. Invalid Choice Handling:

    • When the user enters an invalid choice, the script displays an error message but continues to execute the invalid choice block, leading to unexpected behavior.
  3. Formatting and Readability:

    • The script lacks proper formatting, making it challenging to read and maintain. Consider improving indentation and adding comments for clarity.
  4. Redundant Menu Label:

    • The label :menu is declared twice, which may lead to confusion and potential issues. It is recommended to have a single label for the menu.
  5. Use of call for Subroutines:

    • The call command is used to invoke subroutines, but it might not be necessary in this script. Directly invoking the subroutines is a cleaner approach.
  6. Command Dependency:

    • The script relies on specific commands (e.g., systeminfo, wmic) that may not be available on all systems. Adding checks for command existence would enhance compatibility.

Recommendations

  1. Improve Menu Redirection:

    • Implement a proper exit condition to avoid an infinite loop. Consider adding an option to return to the main menu.
  2. Enhance Invalid Choice Handling:

    • Revise the error handling mechanism to prevent the execution of the invalid choice block.
  3. Enhance Formatting:

    • Improve code formatting by adding proper indentation and comments to enhance readability.
  4. Address Redundant Menu Label:

    • Remove the redundant :menu label and maintain a single label for the menu.
  5. Simplify Subroutine Invocation:

    • Directly invoke subroutines without using the call command, unless there is a specific need for it.
  6. Check Command Availability:

    • Add checks for the availability of commands used in the script to ensure compatibility across different systems.

How to Contribute

Feel free to fork the repository, address the mentioned issues, and submit a pull request. Additionally, you can open new issues if you identify other areas for improvement or encounter bugs.

Thank you for contributing to the enhancement of the Information Choice Batch Script!