I realized that I cant access the file by the name of the client computer. So I had to do a few changes. Now I access the file using IP adrress. The biggest problem was to extract the ip address from windows command line. There is my code:
for /f "delims=[ tokens=2" %%X in ('ping %computername% -n 1 -w 1 ^| find "PING"') do (
for /f "delims=] tokens=1" %%C in ("%%X") do echo %username% %computername% %date% %time% > %%C
It creates a filename named by IP address with username, computer name, date and time inside. Now I am able to access it using REMOTE_ADDR. It is working on Win2k and WinXP. I am not sure about WinNT.