2

I have an ISO file name lfs-ms.iso located at the following directory:

F:\MS\lfs-ms.iso

This ISO file contains an executable called lfs-inst.exe. I use this file many a times so I have to mount the ISO file manually every time and then open this executable. I wish to automate this process by using a command line script (.cmd). So I am building a script that first navigates to this directory, mounts the ISO file there and then opens the executable as mentioned above.

@echo off  

cd  F:\MS\ 

mount lfs-ms.iso 

lfs-inst.exe 

I have tried this but that's not working. Can someone help me how to do it.

Sam
  • 27

2 Answers2

3

By default, doubleclicking an .iso file will mount it in windows 10. If you have not altered this behavior, you can use the following command to do the same:

start lfs-ms.iso

Once the command is executed, the iso is mounted the same way it would be if you double click it.

So a dvd-drive appears in explorer with a driveletter attached to it, and the file is inside. Find out what drive letter the drive has, and use that in your script. I will assume G: here.

The rest of the script can navigate to the drive and execute the file.

Your batch file would look like this:

start lfs-ms.iso
g:
lfs-ms.exe
LPChip
  • 66,193
0
Explorer "D:\A folder\An image.iso"

The above command tells Windows to use Windows Explorer (explorer.exe) to open (mount) the ISO file.