Two scripts, one for installing a bunch of microsoft update files through drag dropping the list on install.bat and beeping when finished, as well as a program for generating the lists. Assuming your system drive is c:\
The beeping requires a text file called beep.txt, this is made by using copy con beep.txt and then typing ctrl g ctrl z enter.
I hope you find it useful.
install.bat
@echo off
cls
REM ----------------------------------------------
:install
echo Installing Please Wait . . . . . .
FOR /F "useback tokens=1,2,3* delims=," %%i IN (%1) DO (
REM echo %%i%%j%%k
set /p t="%%k ...... "< NUL
START /WAIT "" "%%i%%j%%k" /norestart /quiet
echo OK
)
type beep.txt
generate.bat
@echo off
setlocal enabledelayedexpansion
set curpath=%~pd0%
set /p var=Generating Lists . . . . < NUL
REM |-- sends old path to a text file for later retrieval
path > oldpath.txt
FOR /F "tokens=1 delims=" %%i IN (oldpath.txt) DO set str=%%i
REM |-- Cuts out first 5 characters of string and then adds C:\ to path
set str=%str:~5%
set str=%str%C:\;
set path=%str%
REM |-- Checks if list.bat is placed at c:\ for upcoming loop
if not exist C:\list.bat copy list.bat c:\ > NUL
REM |-------------------------------------------------------|
FOR /F "tokens=1" %%i IN (path.txt) DO (
chdir %curpath%%%i
if exist list.txt del list.txt
call list ./ > NuL
)
cd %curpath%
REM |-------------------------------------------------------|
REM | Cleanup |
FOR /F "tokens=1 delims=" %%i IN (oldpath.txt) DO set str=%%i
set str=%str:~5%
set path=%str%
del oldpath.txt
Echo Ok
path.txt -- List of subdirectories to create a list file in
Win7\x86\
Sub\Folder\
list.bat
@echo off
dir /b /a:-d > temp.txt
FOR /F "tokens=1" %%i in (temp.txt) do (
IF "%%i"=="temp.txt" ( echo. ) ELSE (echo %~d1,%~p1,%%i >> list.txt)
)
del temp.txt