Skip to content

Latest commit

 

History

History
138 lines (97 loc) · 5.47 KB

Tips.Windows.CMD.md

File metadata and controls

138 lines (97 loc) · 5.47 KB

Windows CMD Script Tips

References

Cleanup Disk Space, and Low Disk Issues...

https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/determine-the-actual-size-of-the-winsxs-folder https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/clean-up-the-winsxs-folder https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/manage-the-component-store https://docs.microsoft.com/en-us/troubleshoot/windows-client/deployment/address-disk-space-issues-caused-by-winsxs https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/reduce-the-size-of-the-component-store-in-an-offline-windows-image

Hibernate File

ipconfig commands

  • display DNS cache:

    • ipconfig /displaydns
  • flush DNS cache:

    • ipconfig /flushdns

net commands

Suggested Batch Script Coding Conventions

  • NOTE: These are just suggested conventions - having a consistent approach will help others find things - and makes locating sections for possible reuse, easier.

  • Start a batch script with the following commands at the top:

    • @ECHO OFF
    • cls
  • Immediatlely after, include a set of REM lines, to document the following:

    • Name of the script file
    • Semantic version information (i.e. Version x.y.x)
    • Author name
    • Author email
    • Author organization [optional]
    • Author URL (or organization URL) [optional]
    • Github URL to script location
    • Description
  • When creating a name for a branch-to location in a script (i.e. for a goto destination) - use the following naming convention:

    • User UPPER CASE
    • Use "Snake Case" (e.g. YOU_NAME_IT_LIKE_THIS)
    • Prefix the name of the destation with JOB_, or STEP_
  • For Example:

    • JOB_START
    • JOB_SETUP
    • STEP_[NAME]
      • For example:
        • STEP_VALIDATE_PARAMS
        • STEP_CHECK_DRIVE
        • STEP_CHECK_FILE
        • STEP_BEGIN_[PROCESS NAME]
    • JOB_ABORT
    • JOB_END

DOS Shell Script Tips

Advanced Batch Scripting Examples