How can i start the IIS service. And write that result to an TXT file.
Below is the script i have made but it gifs an error on line 9.
Can someone help me.
Break on
$f=2
$date=@DATE
$chr10=Chr(10)
Do
? "@TIME / @DATE"
$www=Run "cmd /c net start W3SVC"
Sleep 15
$iis=Run "cmd /c net start IISADMIN"
Sleep 15
$ftp=Run "cmd /c net start MSFTPSVC"
Sleep 15
$rep=Run "cmd /c net start RpcSs"
Open (1,"D:\scripts\logiis\$date.txt",5)
WriteLine (1,"---------------------------- $chr10 Log van: @TIME/@DATE $chr10 $chr10 De IIS admin service is: $iis $chr10 $chr10 De webservice is:$www $chr10 $chr10 De ftpservice is:$ftp De Replication services is: $rep $chr10 ----------------------------"
Close (1)
Sleep 300
Until $f=1
|