Created
July 13, 2013 00:25
-
-
Save iskernel/5988817 to your computer and use it in GitHub Desktop.
How to fix a corrupt directory using ChkDsk.
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
<# | |
When you attempt to open, delete or rename a file or folder using Windows NT | |
Explorer, File Manager or a command prompt, you may receive one of the | |
following error messages: | |
<drive>:\<folder> is not accessible | |
The file or directory is corrupt and non-readable. | |
The file or directory is corrupt and non-readable. | |
The file or directory \<folder> is corrupt and unreadable. | |
#> | |
#The drive you want to check | |
$drive = "d:" | |
#Runs chkdsk as administrator (requires admin password) | |
runas.exe /savecred /user:administrator "chkdsk /f $drive" | |
#Pauses | |
Write-Host "Press any key to continue ..." | |
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment