xcopy + secure del

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
handsomed
Posts: 1
Joined: 27 Nov 2008 10:01

xcopy + secure del

#1 Post by handsomed » 27 Nov 2008 10:06

I have this code:

xcopy.exe /v/y/e "BlackBerry\pictures\*.*" "I:\Photos\*.*"
del.exe /q/s "BlackBerry\pictures\*.*"


I'd like to delete only in case the xcopy command ends successfully, otherwise show a error message

Any ideas?

DosItHelp
Expert
Posts: 239
Joined: 18 Feb 2006 19:54

#2 Post by DosItHelp » 04 Dec 2008 20:20

handsomed,

How about this:

Code: Select all

xcopy.exe /v/y/e "BlackBerry\pictures\*.*" "I:\Photos\*.*"&&(
    del.exe /q/s "BlackBerry\pictures\*.*"
)

&& - executes the subsequent command only if the previous command succeeded.
DosItHelp? :wink:

Post Reply