Mount an ISO from the Command Line and Get its Drive Letter in Windows 8

5,752

Try this:

for /f "tokens=3 delims=\:" %%d in ('reg query hklm\system\mounteddevices ^| findstr /c:"5C003F00" ^| findstr /v "{.*}"') do (  
    if exist %%d:\vs_ultimate.exe %%d:\vs_ultimate.exe /passive /norestart
)
Share:
5,752

Related videos on Youtube

Elmo
Author by

Elmo

Updated on September 18, 2022

Comments

  • Elmo
    Elmo over 1 year

    I am making a batch script which mounts an ISO file and installs an app (VS 2012) from the mounted location like this:

    K:\Softwares\VS12.iso
    %DRIVE_LETTER%:\vs_ultimate.exe /passive /norestart
    

    But the problem is to get the drive letter in which the ISO is mounted. Does anyone know a way to get the drive letter?