Skip to content

Commit

Permalink
Create fast-disk-repair-tool.py
Browse files Browse the repository at this point in the history
Phyton Script to refresh and remove errors of Windows Disks causing problems to start MagicChatbox.
  • Loading branch information
Lyrikidionisos authored Oct 29, 2024
1 parent 2de63ac commit 1995f5d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 🔘 fix/fast-disk-repair-tool.py
Original file line number Diff line number Diff line change
@@ -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.")

0 comments on commit 1995f5d

Please sign in to comment.