.vbs script to verify copied directories - TechRepublic
General discussion
August 13, 2006 at 04:28 AM
thom0

.vbs script to verify copied directories

by thom0 . Updated 19 years, 10 months ago

Hi. I’m trying to create a script that can copy a whole directory, verify the copy is a match to the original and delete the source only if verification is ok. If verification fails I don’t want anything to happen (maybe delete the created directory or pop up a message box)

I’ve been using this batch file called newmove.bat at the moment;

@rem numove.bat
@echo off

if /i “%1″==”” goto nopar1
if /i “%2″==”” goto nopar2

:main
xcopy /y /e /v /i “%1” “%2”
del /f /s /q “%1”
rd /s /q “%1%”
goto exit

:nopar1
echo.
echo ***Source directory parameter missing***
echo.
echo Usage: numove [sourcedir] [destinationdir]
goto exit

:nopar2
echo.
echo ***Destination directory parameter missing***
echo.
echo Usage: numove [sourcedir] [destinationdir]
goto exit

:exit

I hate to think what happens if the source is deleted and the copy is corrupted. /gulps

Anyone have any idea how to proceed?

Cheers

Theers

This discussion is locked

All Comments