I think there is an error in batch file. I believe it should look like
NET STOP SQLH2PerfCollectorC:\SQLH2\SQLH2.exe /CC:\SQLH2\H2ConfigPerf.xml NET START SQLH2PerfCollectorOtherwise performance file is locked by the service and SQLH2 can not get anything out of it.
It will still work if you just stop and start the service. When the service is restarted, it will create a new file with a different name. The old file will not be locked.
I experienced the same problem as Nikolay Chernavsky. I had to stop the service, then run SQLH2.exe, then start the service in order to avoid the file lock issue.
Below is the error I received when the bat file command order was start service, stop service, run SQLH2.exe:
3/30/2005 7:50:48 AM INFO: D:\SQLH2\PerfCollector\Data\pf033005011842.txt: fid = 7, state = 0, retry = 0
3/30/2005 7:50:48 AM ERROR: The process cannot access the file "D:\SQLH2\PerfCollector\Data\pf033005011842.txt" because it is being used by another process.