I currently have some code that installs all Dell updates silently but I would like the end-user be able to browse for the dell updater msi if it cannot locate it. I'm close but it appears to not like one of the quotes or something after you select the file via the browse option. Can anyone assist?
@echo off
SET file="S:\Software\Dell Command Update\DellCommandUpdate.msi"
if exist "C:\Program Files (x86)\Dell\CommandUpdate\dcu-cli.exe" goto:skipinst
if exist %file% goto:instdellupd
echo Please navigate to the DellCommandUpdate.msi file
set dialog="about:<input type=file id=FILE><script>FILE.click();new ActiveXObject
set dialog=%dialog%('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);
set dialog=%dialog%close();resizeTo(0,0);</script>"
for /f "tokens=* delims=" %%p in ('mshta.exe %dialog%') do set "file=%%p"
:instdellupd
echo Installing Dell Command Update app
start %file% /quiet
:skipinst
echo Running the Dell Command Update app
"C:\Program Files (x86)\Dell\CommandUpdate\dcu-cli.exe" /ApplyUpdates
pause