CODE: [Copy to clipboard]
@echo off
mode con cols=50 lines=15
setlocal enabledelayedexpansion
title 复制脚本
set /p psw=Enter Password:
if not "%psw%" == "56697001" goto endeof
:restart
cls
set/p answer=请输入作业的路径[默认(F:\Access 2003\SS\c)]:
if "%answer%" == "" set answer=F:\Access 2003\SS\c
set/p answer1=要传输的路径[默认(Documents and Settings\Student\桌面\)]:
if "%answer1%" == "" set answer1=Documents and Settings\Student\桌面\
set/p answer2=作为IPC$连接的用户名:
if "%answer2%" == "" goto error
set/p answer3=作为IPC$连接的用户的密码:
if "%answer3%" == "" goto error
:sss
for /f "eol=; tokens=* delims=" %%i in (Computer) do (
echo 正在向%%i复制[%answer%]
net use \\%%i\ipc$ "%answer3%" /user:"%answer2%" 1>nul 2>nul
if not exist "\\%%i\c$\%answer1%\*.*" xcopy "%answer%" "\\%%i\c$\%answer1%" /e /y /c /F
net use \\%%i\ipc$ /del 1>nul 2>nul
)
set/p w1=是否还要再复制一遍[Y/N]:
if "%w1%" == "Y" set w1 = "y" else goto endeof
if "%w1%" == "y" (goto sss) else goto endeof
:error
echo.
echo.
echo 用户名或密码错误!!! & ping -n 2 127.1>nul & goto restart