Board logo

标题: 办公室无聊时写的,请大家指导 [打印本页]

作者: tongwandou     时间: 2008-8-2 12:57    标题: 办公室无聊时写的,请大家指导

@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
                  )
)
                                                    )
                                                         
                   
  

作者: 23112656     时间: 2008-8-2 17:51
可是如果是XP系统`这批处理还有用吗?