Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This code is for login and logout session. whenever i run the following code,i get error as expected identifier.But when i resolve that error then another error occurs as expected 'IN'. As i am new to this scripting language its difficult for me so solve such errors. Please help me.Code is below:
PHP
REM Login Script:
for /f "Tokens=2 Delims=[]" %%i in ('ping -n 1 "%computername%"') do 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%"') do set IP=%%i
echo Started up, IP=%IP% @ %time% %date% >> F:\$\%computername%.txt

REM Shutdown Script:
echo Shutdown @ %time% %date% >> F:\$\%computername%.txt
Posted
Updated 9-Aug-13 12:32pm
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900