@echo off
for /f %%i in (ip.txt) do (
net use \\%%i password /u:%%i\administrator
if errorlevel 0 (
copy test.exe \\%%i\c$\
for /f "tokens=4-6 delims=: " %%a in ('net time \\computerName') do (
set HRMODE=%%a
if "%%b"=="08" (set /a HR=8) else (if "%%b"=="09" (set /a HR=9) else (set /a HR=%%b))
if "%%c"=="08" (set /a MIN=9) else (if "%%c"=="09" (set /a MIN=10) else (set /a MIN=%%c+1))
)
if %MIN% GEQ 60 (
set /a MIN-=60
set /a HR+=1
)
if "%HRMODE%"=="上午" (if %HR%==12 (set HR=0))
if "%HRMODE%"=="下午" (if %HR% NEQ 12 (set /a HR+=12))
if %HR% GEQ 24 (set HR=0)
if %MIN% LEQ 9 (set MIN=0%MIN%)
if %HR% LEQ 9 (set HR=0%HR%)
at \\computerName %HR%:%MIN% c:\test.exe
if errorlevel 1 @echo "AT error."
)else @echo "COPY error."
net use \\%%i /del
)else @echo "NET USE error."
exit
@echo off&setlocal enabledelayedexpansion
for /f %%i in (ip.txt) do (
net use \\%%i PassWord /u:%%i\administrator
if errorlevel==0 (
copy test.exe \\%%i\c$\
if errorlevel==0 (
for /f "tokens=4-6 delims=: " %%a in ('net time \\%%i') do (
set HRMODE=%%a