@echo off SET SRC=\\test-pc01\foo SET DEST=%TEMP%\%RANDOM%.TMP rem Query for installation reg query "HKCR\Software\Microsoft\Multimedia\Components\Installed\codec_wvc1dmo\Uninstall"> NUL 2>NUL if errorlevel 1 goto do_install goto end :do_install rem Make temporary directory and copy down files mkdir "%DEST%" xcopy "%SRC%" "%DEST%" /y rem Change directory and drive to destination location (as setupapi has to be called with rem current directory .\ specified on command line. Dumb, dumb, dumb...) pushd %DEST% %DEST:~0,2% rem Call setupapi to perform installation start /wait rundll32.exe setupapi,InstallHinfSection DefaultInstall.Nt 132 .\wvc1dmo.inf rem Dumb thing doesn't seem to register itself regsvr32 /s %SystemRoot%\System32\wvc1dmod.dll popd rem Remove temporary files rmdir /s /q "%DEST%" :end