From 1995f5df50ef1d9484b45a2bf9793f6e26b13989 Mon Sep 17 00:00:00 2001 From: Lyrikidionisos <98018341+Lyrikidionisos@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:28:38 +0100 Subject: [PATCH] Create fast-disk-repair-tool.py Phyton Script to refresh and remove errors of Windows Disks causing problems to start MagicChatbox. --- .../fast-disk-repair-tool.py" | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 "\360\237\224\230 fix/fast-disk-repair-tool.py" diff --git "a/\360\237\224\230 fix/fast-disk-repair-tool.py" "b/\360\237\224\230 fix/fast-disk-repair-tool.py" new file mode 100644 index 00000000..59ecb6b8 --- /dev/null +++ "b/\360\237\224\230 fix/fast-disk-repair-tool.py" @@ -0,0 +1,20 @@ +import os +import subprocess + +def refresh_disks(): + # Create a temporary script file for diskpart commands + script_content = "rescan\n" + script_path = os.path.join(os.getenv('TEMP'), 'diskpart_script.txt') + + with open(script_path, 'w') as script_file: + script_file.write(script_content) + + # Run the diskpart command with the script + subprocess.run(['diskpart', '/s', script_path], check=True) + + # Clean up the temporary script file + os.remove(script_path) + +if __name__ == "__main__": + refresh_disks() + print("Disk rescan completed.")