Do you need to run automated scripts on NTLite's mounted image folder?
But it's not always assigned to [Temporary directory]\NLTmpMnt01
We can use DISM (on Win 10/11 hosts) to report the mount folder's current path. Using the MountFolder value, you can find which files to edit.
Insert your script commands below the comment line.
CMD:
PowerShell:
But it's not always assigned to [Temporary directory]\NLTmpMnt01
We can use DISM (on Win 10/11 hosts) to report the mount folder's current path. Using the MountFolder value, you can find which files to edit.
Insert your script commands below the comment line.
CMD:
Code:
@echo off
setlocal
for /f "tokens=2,* delims=\" %%a in ('dism /get-mountedimageinfo ^| findstr /C:"Mount Dir"') do set MountFolder=%%b
if "%MountFolder%" == "" (
echo Exiting. No image mounted.
exit /b
)
REM begin here
echo "%MountFolder%"
endlocal
PowerShell:
Code:
$ImageInfo = Get-WindowsImage -Mounted
if ($ImageInfo.MountStatus -ne "Ok") {
Write-Output "Exiting. No image mounted."
exit 0
}
$MountFolder = $ImageInfo.Path.TrimStart('\\?\')
# begin here
Write-Output "`"$MountFolder`""