I have written a .bat file that parses data to a text file, which is then displayed in an html page. Basically the .bat file uses the quser command to query logged on users of servers. Here's an example of the .bat:
Echo MODWK136 >> S:\Query_RDP_MODWK\Result_Quser.txt
quser.exe /Server:MODWK136 >> S:\Query_RDP_MODWK\Result_Quser.txt
Echo MODWK137 >> S:\Query_RDP_MODWK\Result_Quser.txt
quser.exe /Server:MODWK137 >> S:\Query_RDP_MODWK\Result_Quser.txt
If I manually run the .bat it works and the correct info in displayed in the html page. However what I want it to do is to refresh every 30 mins so that the info in the Result_Quser.txt file is updated, hence showing the updated info in the html page.
However if I then run the .bat a second time it doesn't work because it only amends the Result_Quser.txt file rather than overwriting it, hence the html page shows the original data not the new. I have tried using > instead of >> but to no avail.
So my question is how to I overwrite the Result_Quser.txt file rather than amending it. I also want the .bat to run automatically every 30mins - what's the best way to do this - via the .bat?
Thanks for any help!