I'm having an issue getting the commands to output to the STDout stream: #include<Constants.au3>
Local $Output
$STDOut = RunWait(@ComSpec&" /c dfc.exe get /isfrozen",@SystemDir,@SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
While 1
$Output = $Output & StdoutRead($STDOut)
If @error Then ExitLoop
WEnd
While 1
$Output = $Output & StderrRead($STDOut)
If @error Then ExitLoop
WEnd
If StringInStr($Output,"THAWED.") Then
MsgBox(0,"Test","Workstation is thawed.")
ElseIf StringInStr($Output,"FROZEN.") Then
MsgBox(0,"Test","Worksation is frozen.")
Else
MsgBox(0,"Test","Unable to determine workstation state.")
EndIfI have tried various combinations using Run, RunWait, @Comspec & ' /c or 'cmd /c' but have had no success. It seems that you cannot do anything like:$STDOut = RunWait(@ComSpec&" /c dfc.exe get /isfrozen >c:\Temp\STDOut.txt",@SystemDir,@SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
either as this breaks the command and nothing is returned at all. Anyone any ideas on how to get this working or to at the very least get the frozen state of the workstation? Obviously this will be tricky for anyone to test unless they have Deep Freeze installed on a test machine. The long and the short of it is I'm writing a tool that will run at startup to check when the last AV and Windows updates were run, if it is longer than a week, the machine is rebooted thawed and the updates are run, but I need to check the Frozen\Thawed state to be able to determine what needs done next.