Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use the QM code to achieve the following CMD code effect
#1
How to use the QM code to achieve the following CMD code effect ?  

I want to find a 1.txt file in all the partitions on my computer and then copy it to the desktop.

I hope someone can provide a more concise QM code, thanks in advance. Smile
Code:
Copy      Help
@echo off
set src=1.txt
set dst=2.txt
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
 if exist %%a:\nul (
    for /f "delims=" %%i in ('dir /s/a/b/a-d "%%a:\%src%" 2^>nul') do (
        copy "%%i" "%%~dpi%dst%"
    )
 )
)


Messages In This Thread
How to use the QM code to achieve the following CMD code effect - by win - 01-17-2019, 09:31 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)