Hi, Dose someone know how to modify this script below so that it would only include the folders that have an *.inf file in them? Code: @ECHO OFF setlocal enableExtensions enableDelayedExpansion Set "devicePath=%%SystemRoot%%\Inf" & For /d /r "%%SystemDrive%%\Drivers\" %%? in ("*") do Set "devicePath=!devicePath!;%%~?" echo !devicePath! Pause
I found the solution to my problem: Code: For /f "tokens=*" %%? in ('Dir /b /s /a:d "%%SystemDrive%%\D\*"') do If Exist "%%?\*.inf" Set "DevicePath=!DevicePath!;%%?" echo !DevicePath:\=\\!