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
Post a Comment