|
|
|||||||
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 |
||||||||
|
|
|||||||
Your RUN lines are all wrong. See the FAQ Not quite everything you wanted to know about RUN and SHELL |
||||||||
|
|
|||||||
But with out the $ sign it works..... I don't understand that. Do you have an explenation |
||||||||
|
|
|||||||
I don't believe you. You cannot redirect output from RUN to a var with $www=Run! Did you even read the FAQ? |
||||||||
|
|
|||||||
Off course i red the FAQ. But is there an other options be side this one ">>"(Dos command) |
||||||||
|
|
|||||||
THere are several PIPE() UDFs posted that let you skip the redirect to file. |
||||||||
|
|
|||||||
Oke thanks i will have an look around |
||||||||
|
|
|||||||
There are also several SERVICE() UDFs posted that will start and report the status. |