$DiskList = @(Get-PSDrive -PSProvider FileSystem);
$FileName = "%ROOT%.doNotStopHdd"
$SleepSeconds = 59
While($true) {
ForEach($Disk in $DiskList) {
$FilePath = $FileName -replace "%ROOT%",$($Disk.Root)
Try {
New-Item -Path $FilePath -ItemType File -Force -ErrorAction Stop | Out-Null
Remove-Item -Path $FilePath -Force -ErrorAction Stop | Out-Null
Write-Host "File Created-Removed $FilePath"
}
Catch {
Write-Host "Failed $FilePath"
}
} #END ForEach
Start-Sleep -Seconds $SleepSeconds
} #END While
PowerShell.EXE -STA -NoLogo -NonInteractive -WindowStyle Hidden -ExecutionPolicy Unrestricted C:\PathToPowershellScript.PS1
http://username:password@members.dyndns.org/nic/update?hostname=yourhostname&myip=ipaddress&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG