Announcement

Collapse
No announcement yet.

Help to write script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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. thanks

  • #2
    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
    )
    )
    )

    Comment


    • #3
      helo... can anyone help please..???

      Comment


      • #4
        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:
        https://www.indigorose.com/webhelp/a....Enumerate.htm
        You can see which letters are being used, so now use this result and see which of those you want are still free.

        Ulrich

        Comment


        • #5
          OK thanks Ulrich
          i will try

          Comment

          Working...
          X