Skip to content

Instantly share code, notes, and snippets.

@liyafe1997
Created May 3, 2020 08:47
Show Gist options
  • Save liyafe1997/2be0e28696de889af3546ebf1ce1523a to your computer and use it in GitHub Desktop.
Save liyafe1997/2be0e28696de889af3546ebf1ce1523a to your computer and use it in GitHub Desktop.
For move Desktop to a iSCSI drive and detect at startup(some time iSCSI load slower than explorer.exe)
echo off
title 请不要关闭本窗口
cls
echo 正在连接iSCSI......
echo 如果长时间连接不上,请检查网络
if not exist D:\Desktop (
goto aaa
) else (
exit
)
:aaa
taskkill /im explorer.exe /f >NUL 2>NUL
:bbb
if not exist D:\Desktop (
taskkill /im explorer.exe /f >NUL 2>NUL
ping 127.0.0.1 -n 2 >NUL 2>NUL
goto bbb
) else (
explorer.exe
powershell -file startautorun.ps1
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment