| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7ad52d1 commit b0898f4
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -729,6 +729,45 @@ def collect_windows(info_add): | |||
| 729 | 729 | except (ImportError, AttributeError): | |
| 730 | 730 | pass | |
| 731 | 731 | ||
| 732 | + import subprocess | ||
| 733 | + try: | ||
| 734 | + proc = subprocess.Popen(["wmic", "os", "get", "Caption,Version", "/value"], | ||
| 735 | + stdout=subprocess.PIPE, | ||
| 736 | + stderr=subprocess.PIPE, | ||
| 737 | + text=True) | ||
| 738 | + output, stderr = proc.communicate() | ||
| 739 | + if proc.returncode: | ||
| 740 | + output = "" | ||
| 741 | + except OSError: | ||
| 742 | + pass | ||
| 743 | + else: | ||
| 744 | + for line in output.splitlines(): | ||
| 745 | + line = line.strip() | ||
| 746 | + if line.startswith('Caption='): | ||
| 747 | + line = line.removeprefix('Caption=').strip() | ||
| 748 | + if line: | ||
| 749 | + info_add('windows.version_caption', line) | ||
| 750 | + elif line.startswith('Version='): | ||
| 751 | + line = line.removeprefix('Version=').strip() | ||
| 752 | + if line: | ||
| 753 | + info_add('windows.version', line) | ||
| 754 | + | ||
| 755 | + try: | ||
| 756 | + proc = subprocess.Popen(["ver"], shell=True, | ||
| 757 | + stdout=subprocess.PIPE, | ||
| 758 | + stderr=subprocess.PIPE, | ||
| 759 | + text=True) | ||
| 760 | + output = proc.communicate()[0] | ||
| 761 | + if proc.returncode: | ||
| 762 | + output = "" | ||
| 763 | + except OSError: | ||
| 764 | + return | ||
| 765 | + else: | ||
| 766 | + output = output.strip() | ||
| 767 | + line = output.splitlines()[0] | ||
| 768 | + if line: | ||
| 769 | + info_add('windows.ver', line) | ||
| 770 | + | ||
| 732 | 771 | ||
| 733 | 772 | def collect_fips(info_add): | |
| 734 | 773 | try: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments