I have an ISO file that I copied off of an old game disk. But in order for me to play the game, I have to mount the ISO.
I wrote a small Batch file that runs the .ps1 PowerShell file to mount the ISO and then runs the EXE to start the game after it has been mounted. My problem is, if I run the script more than once it will mount the ISO again.
I want to check if the ISO is attached, mount it if it is not, or run the EXE if it is.
Here's what I have to mount the ISO:
Batch.
ECHO "Mounting Stunt Track Driver"
@ECHO off
Powershell.exe -executionpolicy remotesigned
-File "C:\Users\Allen\Documents\Games\Hot Wheels Stunt Track
Driver\setup\hot98\mount.ps1"
start /d "C:\Users\Allen\Documents\Games\Hot Wheels Stunt Track
Driver\setup\hot98" stunt.exe
PowerShell
#mounts the image
Mount-DiskImage -ImagePath "C:\Users\Allen\Documents\Games\Hot Wheels Stunt
Track Driver\setup\hot98\HotwheelsStuntTrack.iso"
this snippet will only mount image if it's not mounted :
if(!(get-DiskImage -ImagePath C:\testshare\97001.ISO).Attached){
Mount-DiskImage -ImagePath C:\testshare\97001.ISO
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With