Skip to content

Commit 5a98764

Browse files
committed
Win: Fix hddon.ps1 and hddoff.ps1
Windows seems to spin the harddrives up even if disabled. Try removing the devices (same as clicking "Uninstall device" in MS Windows Device Manager).
1 parent 1dc8c1d commit 5a98764

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Windows_1X/win_dotfiles/hddoff.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ if ($model -ne $expectedModel -or $serial -ne $expectedSerial) {
6262
}
6363

6464
# & is used to execute a command string with spaces
65-
& $devcon disable "*WD102KRYZ-01A5AB0*"
65+
# TODO figure out why longer paths do not work
66+
& $devcon remove "*SCSI\DISK&VEN_WDC&PROD_WD102KRYZ-01A5AB\7&16843F94&0&010000*"
67+
& $devcon remove "*PROD_WD102KRYZ-01A5AB*"
68+
& $devcon remove "*WD102KRYZ-01A5AB0*"
6669
pause
6770

Windows_1X/win_dotfiles/hddon.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ $expectedSerial = "VH1JR5YM"
99
$hdparm = "C:\Program Files (x86)\hdparm\hdparm.exe"
1010
$devcon = "C:\Program Files (x86)\Windows Kits\10\Tools\10.0.26100.0\x64\devcon.exe"
1111

12+
& $devcon rescan
1213
& $devcon enable "*WD102KRYZ-01A5AB0*"
1314

1415
foreach ($dev in 'sda','sdb','sdc','sdd','sde','sdf','sdg','sdh') {
@@ -29,4 +30,4 @@ foreach ($dev in 'sda','sdb','sdc','sdd','sde','sdf','sdg','sdh') {
2930

3031
if ($model -ne $expectedModel -or $serial -ne $expectedSerial) {
3132
Write-Warning "❌ Target drive not found."
32-
}
33+
}

0 commit comments

Comments
 (0)