What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Possible with a batch file?

Possible with a batch file?
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Possible with a batch file?
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).

.zip File Attachment: SYNC.zip (672 bytes)
This file has been downloaded 126 time(s).

This post was edited on 07-20-2009 at 01:30 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-20-2009 12:13 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Possible with a batch file? - by Jimbo on 07-18-2009 at 10:38 AM
RE: Possible with a batch file? - by ShawnZ on 07-18-2009 at 12:00 PM
RE: Possible with a batch file? - by Jimbo on 07-18-2009 at 01:07 PM
RE: Possible with a batch file? - by ShawnZ on 07-18-2009 at 01:47 PM
RE: Possible with a batch file? - by Jimbo on 07-18-2009 at 02:22 PM
RE: Possible with a batch file? - by ShawnZ on 07-18-2009 at 02:27 PM
RE: Possible with a batch file? - by Jimbo on 07-18-2009 at 02:56 PM
RE: Possible with a batch file? - by CookieRevised on 07-20-2009 at 12:13 AM
RE: Possible with a batch file? - by Mike on 07-20-2009 at 12:34 AM
RE: Possible with a batch file? - by Jimbo on 07-24-2009 at 08:07 PM
RE: Possible with a batch file? - by dimitrifrom31 on 08-07-2009 at 05:36 PM
RE: Possible with a batch file? - by dimitrifrom31 on 08-07-2009 at 08:26 PM
RE: Possible with a batch file? - by ShawnZ on 08-08-2009 at 12:42 AM
RE: Possible with a batch file? - by dimitrifrom31 on 08-08-2009 at 12:48 AM
RE: Possible with a batch file? - by ShawnZ on 08-08-2009 at 12:49 AM
RE: Possible with a batch file? - by dimitrifrom31 on 08-08-2009 at 01:34 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On