因每次都要去LAN中的另一台电脑中去登录文件(file1,file2),但file1,file2时常被人删
偶就编了下面的批处理(偶是菜鸟),用做file1,file2备份,偶想做的更好些,请大家帮忙。
要求:1、在建立边接之前先判断要边的那个IP在不在,在则边,不在给出提示,退出或直接退出。
2、能不能用errorlevel 代替else ,可以的话,请帮忙写出来,偶不会用errorlevel goto。
也不懂返回码,,,那位大虾懂,,教下偶,,,
3、有更好的批处理,请贴出来,,多谢。。。
4、如何判断命令执行后的返回码,,请教大虾们。。。。
==============begin================================
@echo off
net use \\ip address\share password /user:userneme
if exist \\ip address\share\file1 (
copy \\ip address\share\file1 f:\backup
) else (
copy f:\backup\file1 \\ip address\share
)
if exist \\ip address\share\file2 (
copy \\ip address\share\file2 f:\backup
) else (
copy f:\backup\file2 \\ip address\share
)
exit
==============end===================================
偶就编了下面的批处理(偶是菜鸟),用做file1,file2备份,偶想做的更好些,请大家帮忙。
要求:1、在建立边接之前先判断要边的那个IP在不在,在则边,不在给出提示,退出或直接退出。
2、能不能用errorlevel 代替else ,可以的话,请帮忙写出来,偶不会用errorlevel goto。
也不懂返回码,,,那位大虾懂,,教下偶,,,
3、有更好的批处理,请贴出来,,多谢。。。
4、如何判断命令执行后的返回码,,请教大虾们。。。。
==============begin================================
@echo off
net use \\ip address\share password /user:userneme
if exist \\ip address\share\file1 (
copy \\ip address\share\file1 f:\backup
) else (
copy f:\backup\file1 \\ip address\share
)
if exist \\ip address\share\file2 (
copy \\ip address\share\file2 f:\backup
) else (
copy f:\backup\file2 \\ip address\share
)
exit
==============end===================================
