Код:

$sDrive = "H:\"
$sTmpFileName = $sDrive & "test.tmp"
ConsoleWrite($sDrive & " " & DriveStatus($sDrive) & ' ' & DriveGetType($sDrive) & @LF)
$hFile = FileOpen ( $sTmpFileName ,1 )
If $hFile==-1 Then
ConsoleWrite("Error open file in write mode." & @LF)
Else
ConsoleWrite("Ok." & @LF)
FileClose ($hFile)
FileDelete ($sTmpFileName)
EndIf