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.")