Created
February 15, 2024 14:24
-
-
Save andmerk93/e52992d379a5f7ca68896d64f5b00fb7 to your computer and use it in GitHub Desktop.
driverquery с выводом драйверов с типом File System
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Скрипт на Python, который будет запускать утилиту driverquery | |
с сохранением результатов в файл, а потом открывать этот файл | |
и выводить только драйвера с типом File System | |
Сделано в качестве тестового задания, 2024 | |
""" | |
from csv import DictReader | |
from subprocess import Popen | |
from pprint import pprint | |
Popen(('driverquery /fo csv > drivers.csv'), shell=True) | |
with open('drivers.csv', 'r', encoding='utf-8', errors='ignore') as file: | |
for row in DictReader(file): | |
if 'File System' in str(row['Тип драйвера']): | |
pprint(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment