Open a file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
laishramsanjoy1
Posts: 1
Joined: 24 Dec 2017 11:39

Open a file

#1 Post by laishramsanjoy1 » 24 Dec 2017 11:43

I created an iso file using UltraISO. The file file system on that iso file is (Home\Memory\..\a.txt). how to open the a.txt using cmd.

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Open a file

#2 Post by aGerman » 24 Dec 2017 15:33

You can't. You need to extract that file out of your ISO beforehand.

Steffen

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: Open a file

#3 Post by penpen » 24 Dec 2017 17:37

Alternatively you may mount the iso image.

For example under windows 10 this should open the file "test.txt" in the root directory of the iso image:

Code: Select all

@echo off
setlocal enableExtensions disableDelayedExpansion
set "iso=.\cdimg.iso"

:: mount iso image
set "mountedVolume="
for %%a in ("%iso%") do for /F %%b in ('PowerShell  -Command "Mount-DiskImage -ImagePath "%%~fa" -PassThru | Get-Volume"') do set "mountedVolume=%%~b"

:: use the iso image
notepad "%mountedVolume%:\test.txt"

:: unmount iso image
for %%a in ("%iso%") do PowerShell  -Command  Dismount-DiskImage  -ImagePath  "%%~fa"
endlocal
goto :eof
Depending on your windows version you might need to install some "virtual disk software" and replace the mount and umount commands.

penpen

Post Reply