Yes, it sure is all possible (in multiple ways)...
But I realy can't understand what you realy/exactly want to do though....
You need to give proper and very clear examples of each step if you want people to be able to create a batch file.
Are there any files listed in that "other .txt" which are not in 'folder2'?
Or is that "other txt" simply a list of all the files in 'folder2'?
Are there any files in 'folder1'?
Must the files in 'folder1' also be copied to 'C:/inetpub/wwwroot/folder1'?
Are there more subfolders 'folder3', 'folder4', etc under 'folder1'?
Are there other folders like 'folder1' under the C root and must they also be copied to 'c:\inetpub\wwwroot'?
BZip each file in 'folder2' to 'C:/inetpub' or to 'C:/inetpub/wwwroot/folder1/folder2'?
Give an extensive but exact BZip command line example, including the correct parameters, subpaths, quotes, filenames, etc so I can add it properly.
etc...
etc...
I am going to assume a lot of things here:
batch code:
@ECHO OFF
:: Be carefull, since Delayed Expansion is enabled, there will be errors if files contain "!" or other special characters in their path/file name.
:::::::::::::::::::::::::::::::::::::::::::::::
SET WWWDIR=C:\INETPUB\WWWROOT
SET LISTFILE=C:\STUFF\LIST\DEFAULT.LST
SET BZIPFILE=C:\UTILS\BZIP2.EXE
:::::::::::::::::::::::::::::::::::::::::::::::
VERIFY EXTTEST 2>NUL
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
IF ERRORLEVEL 1 GOTO NOEXTENSIONS
FOR /R %%F IN (*.*) DO (
IF NOT "%%F"=="%~0" (
SET FILE=%%F
ECHO Copying !FILE:%CD%\=!...
ECHO !FILE:%CD%\=! 2>NUL 3>&2 1>>%LISTFILE%
MD %WWWDIR%%%~pF 1>NUL 2>&1
COPY %%F %WWWDIR%%%~pF /Y 1>NUL 2>&1
ECHO Compressing !FILE:%CD%\=!...
%BZIPFILE% -fzkq9 "%WWWDIR%%%~pnxF"
)
)
ECHO.
ECHO "%LISTFILE%" updated
ECHO.
ECHO Press any key to end...
PAUSE 1>NUL
ECHO.
GOTO END
:NOEXTENSIONS
ECHO.
ECHO ERROR: Command extensions can not be enabled.
ECHO (possible cause: wrong DOS/Windows version)
GOTO END
:END
Also see attached batch file.
Edit the batch file (the three variables between the :::: lines) before using.
Put that batch file in each '
folder1' and run it from there.
It will also copy files under 'folder1', except itself.
It will bzip each file under C:/inetpub/wwwroot/folder1 without moving it to somewhere else (so you will have two versions of each file in each directory).