Jump to content

ROBOCOPY using batch


Recommended Posts

Hi guys, i need to copy two files from a DVD-R to the %SystemDrive% folder using ROBOCOPY command with a batch file located in the same DVD-R dir of the two files to copy

My problem is that i don't know how specify as source the dir of the batch file...

For now this is my script:

@SETLOCAL ENABLEEXTENSIONS
@CD /D "%~dp0"
ROBOCOPY "???" "%SystemDrive%" file1.ext
ROBOCOPY "???" "%SystemDrive%" file2.ext

Feel free to fully rewrite my batch. Thank you in advance!

Link to comment
Share on other sites


There's no reason why you cannot use the DISM command replacing %~dp0 with "%_:~,-1%". You shouldn't need the RD command ife you're running it from optical media which is read only.

Link to comment
Share on other sites

Infact there is no reason to use the RD command running a DVD-R but how could it possible to use both commands (ROBOCOPY and DISM) with the same batch (without RD obviously)? On ss64.com i've read that XCOPY is deprecated with the newer O.S. and we should use ROBOCOPY, but in case of problems i can replace it with the old and simple XCOPY.

If you can, could you write an example of a correct SetupComplete.cmd integrating both ROBOCOPY or XCOPY and DISM please? Thanks :)

Edited by Caml Light
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...