简体   繁体   中英

Batch command to move directory to another directory

I have an .exe that produces a directory and a .zip of that directory.

I can move the .zip file into a another directory using:

move /y C:XXX/*.zip C:YYY/

I try moving the raw directory using something like this, but it gives me a filename/directory syntax error.

move /y C:XXX/Data* C:YYY

I am using a wildcard because the number may change at times but Data will always be there. Does anyone know another method?

for /d %%a in (c:xxx\data*) do move "%%~fa" c:yyy

for each folder matching the indicated set, move the folder to the target. The syntax is for batch usage. To use from command line, replace %% with %

But this (the move command) will fail if the moved folder still exists on target.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM