中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-09 08:27
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 办公室无聊时写的,请大家指导 查看 663 回复 1
楼 主 办公室无聊时写的,请大家指导 发表于 2008-08-02 12:57 ·  中国 北京 电信
初级用户
★★
积分 112
发帖 50
注册 2007-04-15 00:59
19年会员
UID 85191
性别 男
状态 离线
@echo off
net use \\192.168.1.178\ipc$ 123456 /user:administrator | find "成功" && if ERRORLEVEL 0 (echo 太好了,继续努力.
for /f "tokens=4,5" %%a in ('net time \\192.168.1.178') do (
if "%%a"=="下午" goto :2
echo 原始时间是---%%b
for /f "tokens=1* delims=:" %%j in ("%%b") do (
setlocal enabledelayedexpansion
set /a c="%%k"+1
if !c! GEQ 10 if !c! LEQ 59 (at \\192.168.1.178 %%j:!c! net share e$=e:
at \\192.168.1.178 %%j:!c! net share c$=c:
at \\192.168.1.178 %%j:!c! net share d$=d:
at \\192.168.1.178 %%j:!c! net share f$=f:
echo 改变后的时间是---%%j:!c!
goto :eof )
if !c! LEQ 10 (at \\192.168.1.178 %%j:0!c! net share e$=e:
at \\192.168.1.178 %%j:!c! net share c$=c:
at \\192.168.1.178 %%j:!c! net share d$=d:
at \\192.168.1.178 %%j:!c! net share f$=f:

echo 改变后的时间是---%%j:0!c!
goto :eof
)
if !c! GEQ 59 (set /a m=%%j+1
at \\192.168.1.178 !m!:00 net share e$=e:
at \\192.168.1.178 %%j:!c! net share c$=c:
at \\192.168.1.178 %%j:!c! net share d$=d:
at \\192.168.1.178 %%j:!c! net share f$=f:
echo 改变后的时间是---%%j:!c!
goto :eof
)

)
)
)


:2
for /f "tokens=5" %%q in ('net time \\192.168.1.178') do (
echo 原始时间是---%%q
for /f "tokens=1* delims=:" %%r in ("%%q") do (
setlocal enabledelayedexpansion
set /a n="%%r"+12
set /a o="%%s"+1

if !o! GEQ 10 if !o! LEQ 59 (at \\192.168.1.178 !n!:!o! net share e$=e:
at \\192.168.1.178 !n!:!o! net share c$=c:
at \\192.168.1.178 !n!:!o! net share d$=d:
at \\192.168.1.178 !n!:!o! net share f$=f:
echo 改变后的时间是---!n!:!o!
goto :eof )
if !o! LEQ 10 (at \\192.168.1.178 !n!:0!o! net share e$=e:
at \\192.168.1.178 !n!:!o! net share c$=c:
at \\192.168.1.178 !n!:!o! net share d$=d:
at \\192.168.1.178 !n!:!o! net share f$=f:
echo 改变后的时间是---!n!:0!o!
goto :eof
)
if !o! GEQ 59 (set /a p=!n!+1
at \\192.168.1.178 !p!:00 net share e$=e:
at \\192.168.1.178 !p!:00 net share c$=c:
at \\192.168.1.178 !p!:00 net share d$=d:
at \\192.168.1.178 !p!:00 net share f$=f:
echo 改变后的时间是---!n!:!o!
goto :eof
)
)
)


2 发表于 2008-08-02 17:51 ·  中国 云南 昆明 电信
中级用户
★★
积分 220
发帖 99
注册 2008-06-26 15:12
18年会员
UID 120818
性别 男
状态 离线
可是如果是XP系统`这批处理还有用吗?
论坛跳转: