NAS - 翼展电脑服务中心


ISCSI全自动安装、连盘、退盘更改盘符等批处理命令 umin

2019-3-31 乱云飞 评论(0) 浏览(917) 标签: ISCSI NAS

2205_1349766963cUn9.png
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
预ICP备10086-001号 © 翼展网/80C.CC 技术支持/洛阳翼展科技
TEL / 13213610060 QQ / 345794501
Powered by emlog