1.

Solve : Batch Script To Log Only The Names Of Files In a Backup Job?

Answer»

Please I need a batch script that will log only the names of files in a backup job. I'm using the batch script below but the log FILE includes the path of the source files as well, how do I remove the path from the log?

@echo off
:: variables
set drive=E:\Backup
set backupcmd=XCOPY /s /c /d /e /h /i /r /y

echo ### Backing up My Documents...
%backupcmd% "%USERPROFILE%\My Documents\My Pictures" "%drive%\My Documents" >> "c:\Batch\somelogfile.txt"

echo Backup Complete!
@pause
I found the answer to my question avove just in case someone else is interested here is the script:

echo ### Backing up %Extension%... To: SingleDirectory Folder
FOR /R "C:\" %%a in ("*%Extension%") DO xcopy "%%a" "%Drive%\SingleDirectory"
:: http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/Q_21509134.html
dir "%Drive%\SingleDirectory"\*.* /b > "%Drive%\SingleDirectorylog.txtJust a note: experts-exchange is a pay site (you have to subscribe with a credit card to SEE "solutions". They say "30 day free trial" but are you prepared to risk that they will not honor your cancellation and charge the card anyway? Given that they are charging you to see information that (a) they did not find themselves and (b) that you could find elsewhere for free, I don't rate their ethics very highly)


Please note that I did not pay a panny to experts-exchange.com the code above was on their website just scroll down to the bottom of the page.Quote from: JavaAndCsharp on DECEMBER 26, 2010, 10:57:54 PM

Please note that I did not pay a panny to experts-exchange.com the code above was on their website just scroll down to the bottom of the page.

The solution is blurred out until you login/register, the latter of which requires GIVING credit card details.When I got the code it wasn't blurred out, good job this was so as I need the code for a project I was working on at the time. Quote from: BC_Programmer on December 26, 2010, 11:00:12 PM
The solution is blurred out until you login/register, the latter of which requires giving credit card details.

It's not blurred out in Google's cache... am I allowed to say that here?


Discussion

No Comment Found