wsh - getting expected identifier error in windows script host using vbscript -


i'm writing windows script host code on login , logout session. when user logs system, timestamp being recorded , when user logs out again timestamp being recorded. have mentioned code below getting error expected identifier , i'm finding difficult resolve it.

rem login script:

for /f "tokens=2 delims=[]" %%i in ('ping -n 1 "%computername%"') set ip=%%i  echo %username% logged on %computername%, ip=%ip% @ %time% %date% >> f:\$\%username%.txt 

rem logoff script:

echo %username% logged off %computername% @ %time% %date% >> f:\$\%username%.txt  

rem startup script:

for /f "tokens=2 delims=[]" %%i in ('ping -n 1 "%computername%"') set ip=%%i echo started up, ip=%ip% @ %time% %date% >> f:\$\%computername%.txt 

rem shutdown script:

echo shutdown @ %time% %date% >> f:\$\%computername%.txt   


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -