批处理连接、断开、修改ISCSI虚拟盘盘符脚本
作者:admin 日期:2009-04-20
复制内容到剪贴板
程序代码
程序代码echo off
::断开虚拟盘。
for /f "usebackq delims=: tokens=2" %%i in (`iscsicli SessionList^|find /i "Session Id"`) do iscsicli LogoutTarget %%i
::连接虚拟盘,把192.168.1.15改为你的服务器IP。
iscsicli AddTargetPortal 192.168.1.15 3260
iscsicli LoginTarget iqn.2005-02.com.ricecake.iscsi:00 T * * * * * * * * * * * * * * * 0
::修改盘符,例子中是把F盘挂在为Q盘,根据你的需要修改。
set old=F:
set new=Q:
for /f %%i in ('mountvol %old% /l') do set "vol=%%i"
mountvol %old% /d
mountvol %new% %vol%
popd
::断开虚拟盘。
for /f "usebackq delims=: tokens=2" %%i in (`iscsicli SessionList^|find /i "Session Id"`) do iscsicli LogoutTarget %%i
::连接虚拟盘,把192.168.1.15改为你的服务器IP。
iscsicli AddTargetPortal 192.168.1.15 3260
iscsicli LoginTarget iqn.2005-02.com.ricecake.iscsi:00 T * * * * * * * * * * * * * * * 0
::修改盘符,例子中是把F盘挂在为Q盘,根据你的需要修改。
set old=F:
set new=Q:
for /f %%i in ('mountvol %old% /l') do set "vol=%%i"
mountvol %old% /d
mountvol %new% %vol%
popd
评论: 0 | 引用: 0 | 查看次数: 949
发表评论
上一篇:为什么内网正常外网访问不...
下一篇:用注册表优化 提高NTF...
文章来自:
Tags:
相关日志:




