|
acme
中级用户
积分 238
发帖 98
注册 2007-4-10 来自 陕西
状态 离线
|
『楼 主』:
资料move失败如何提示出来让使用者知道呢?
我用以下的批处理来完成资料的转移储存,请教大哥如何实现在资料move失败后提示出来呢?《如以下红色部分》
----------------------------------------------------------------------------------------------------
@echo off
schtasks /create /tn pcl /tr (e:\move-9)/sc once /st (23:15:00)
set dd=%time:~0,2%
if "%dd%"=="23" goto mm
:open
echo ============================================
echo 友情提示:
echo 目前不是AOI资料转移系统设置运行时间!
echo 您需要强制运行系统吗?会造成资料异常!
echo 需要强制执行请输入Y,推出系统请输入N!
echo ============================================
SET /P ST=请输入 Y 或 N:
If /I "%ST%"=="Y" goto mm
if /I "%ST%"=="N" goto exit
:mm
echo *****欢迎使用AOI资料移动系统*****
echo 资料夹建立中,请稍候.......
e:
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\ALINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\BLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\CLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\DLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\ELINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\FLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\GLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\HLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\ILINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\JLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\KLINE\%%i%%j%%k
echo 完成建立!
echo 资料转移中,请稍候......!
set aa=%date:~4,10%
move \\AREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\ALINE\%aa%\
move \\BREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\BLINE\%aa%\
move \\CREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\CLINE\%aa%\
move \\DREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\DLINE\%aa%\
move \\EREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\ELINE\%aa%\
move \\FREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\FLINE\%aa%\
move \\GREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\GLINE\%aa%\
move \\HREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\HLINE\%aa%\
move \\IREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\ILINE\%aa%\
move \\JREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\JLINE\%aa%\
move \\KREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\KLINE\%aa%\
echo =============================================
echo 转移完毕!
echo Press any key to continue......
echo =============================================
echo. & pause
Exit
: exit
ping /n 1 127.1
echo =================
echo 您选择了推出系统!
echo =================
ping /n 5 127.1
exit
|
一切皆有可能!我行!我能! |
|
2007-5-25 22:36 |
|
|
lxmxn
版主
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第
2 楼』:
在红色代码的后面加上" || echo 失败 " 试试.
|
|
2007-5-25 23:13 |
|
|
bjsh
银牌会员
积分 2000
发帖 621
注册 2007-1-1
状态 离线
|
『第
3 楼』:
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\ALINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\BLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\CLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\DLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\ELINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\FLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\GLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\HLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\ILINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\JLINE\%%i%%j%%k
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do md E:"\AOI SYSTEM TEST RECORD"\2007\KLINE\%%i%%j%%k
建议改成:
for %%l in (A B C D E F G H I J K) do (
for /f "tokens=1-3 delims=\" %%i in ('echo %date:~4,10%') do (
md E:"\AOI SYSTEM TEST RECORD"\2007\%%lLINE\%%i%%j%%k
)
)
同样
move \\AREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\ALINE\%aa%\
move \\BREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\BLINE\%aa%\
move \\CREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\CLINE\%aa%\
move \\DREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\DLINE\%aa%\
move \\EREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\ELINE\%aa%\
move \\FREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\FLINE\%aa%\
move \\GREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\GLINE\%aa%\
move \\HREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\HLINE\%aa%\
move \\IREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\ILINE\%aa%\
move \\JREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\JLINE\%aa%\
move \\KREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\KLINE\%aa%\
这个改成
for %%i in (A B C D E F G H I J K) do move \\%%lREPAIR\DDRIVER\REPAIR\*.* E:\"AOI SYSTEM TEST RECORD"\2007\%%iLINE\%aa%\ || echo "Failed"
|
|
2007-5-26 08:52 |
|
|
kgdetg1127
初级用户
积分 158
发帖 89
注册 2007-4-25
状态 离线
|
|
2008-1-8 22:32 |
|
|