Yahoo 知識+ 將於 2021 年 5 月 4 日 (美國東岸時間) 停止服務,而 Yahoo 知識+ 網站現已轉為僅限瀏覽模式。其他 Yahoo 資產或服務,或你的 Yahoo 帳戶將不會有任何變更。你可以在此服務中心網頁進一步了解 Yahoo 知識+ 停止服務的事宜,以及了解如何下載你的資料。

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

更新:

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 個解答

相關度
  • ?
    Lv 7
    1 十年前
    最愛解答

    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.

還有問題嗎?立即提問即可得到解答。