help .. how to write this cmd script using AMS. ::This file will get a free drive letter starting at U: for /f "usebackq tokens=1*" %%a in (`FSUTIL FSINFO DRIVES ^| find ":"`) do ( if /i "%%a" NEQ "Drives:" ( set drives=!drives! %%a ) else ( set drives=%%b ) ) for %%a in (U T S R Q P O N M L K J I H G F E D V W X Y Z) do ( echo %drives% | find /i "%%a:" >nul 2>nul if errorlevel 1 ( net use %%a: >nul 2>nul if errorlevel 1 ( ::echo %%a & pause set SPAREVOL=%%a: set drives= goto :EOF ) ) ) or is there another way if using a script AMS / LUA Sorry, my English is bad. thanks
help .. how to write this cmd script using AMS. ::This file will get a free drive letter starting at U: for /f "usebackq tokens=1*" %%a in (`FSUTIL FSINFO DRIVES ^| find ":"`) do ( if /i "%%a" NEQ "Drives:" ( set drives=!drives! %%a ) else ( set drives=%%b ) ) for %%a in (U T S R Q P O N M L K J I H G F E D V W X Y Z) do ( echo %drives% | find /i "%%a:" >nul 2>nul if errorlevel 1 ( net use %%a: >nul 2>nul if errorlevel 1 ( ::echo %%a & pause set SPAREVOL=%%a: set drives= goto :EOF ) ) ) or is there another way if using a script AMS / LUA Sorry, my English is bad. thanks