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
Announcement
Collapse
No announcement yet.
Help to write script
Collapse
X
-
Help to write script
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. thanksTags: None
-
Sorry...
this my script :
Can any help me..?
::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
)
)
)
-
Instead you waiting that somebody does this for you, I suggest that you check the documentation for the action which actually can be used in AutoPlay Media Studio to find the drives:
You can see which letters are being used, so now use this result and see which of those you want are still free.
Ulrich
- Likes 1
Comment
Comment