From 7b0b1b1aa68940c04b2b07622eb8e57988e0be28 Mon Sep 17 00:00:00 2001 From: sibalzer Date: Tue, 21 Dec 2021 16:22:22 +0100 Subject: [PATCH] fix(windows): prevent console from closing when running as an --- log4j-finder.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/log4j-finder.py b/log4j-finder.py index c2b6498..fe4b821 100755 --- a/log4j-finder.py +++ b/log4j-finder.py @@ -364,6 +364,9 @@ def main(): print(f"[{now}] {hostname} Finished scan, elapsed time: {elapsed:.2f} seconds") print_summary(stats) print(f"\nElapsed time: {elapsed:.2f} seconds") + # If script is running as an frozen executable on Windows, prevent the console from closing. + if sys.platform == "win32" and getattr(sys, 'frozen', False): + os.system("pause") if __name__ == "__main__":