Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Batch File XCOPY command?

I need to load software from a flash drive onto the desktop relatively fast (plug in, plug out fast) on about 15-20 computers.

I have looked up XCOPY batch file commands, and it seems to depend on set file locations, even though different laptops assign flash drives to different drives (some E:\, some F:\, my desktop is L:\) so I was wondering if I could get a file location relative to my batch file.

here is my script:

ECHO OFF

CLS

:MENU

ECHO.

ECHO .........

ECHO Press 1 to continue, 2 to exit

ECHO .........

ECHO.

ECHO 1 - Copy Files from Flash

ECHO 2 - EXIT

ECHO.

SET /P M=Type 1 or 2, then press ENTER:

IF %M%==1 GOTO COPY

IF %M%==2 GOTO EOF

:COPY

XCOPY "\Copy\*.*" "%userprofile%\Desktop\VGDC"

GOTO EOF

thanks in advance

Update:

thanks so much, I temporarily lost my flash drive, so I was trying from desktop folder to another desktop folder.

It works now that I have loaded it onto a flash drive. The only issue right now is ejecting the drive afterwards, could anyone help?

1 Answer

Relevance
  • ?
    Lv 7
    1 decade ago
    Favorite Answer

    xcopy works fine with relative file locations; if you put this on the flash drive as you ahve it shown, it should run without a problem.

Still have questions? Get your answers by asking now.