简体   繁体   中英

windows 7 bat file leaves out parts of the command

I made a batch file with one command in it so that i dont have to remember the code. thought it would be simple however the code that it prints out when running it is not the code that is in the file. heres the only line in the file

 for /f "tokens=*" %f in ('dir /a:-D /s /b') do move "%f" .

I have run this code in the command prompt and it does what i want it to however when i put it in a batch file and run it this the code that is read by the cmd

C:\Users\Erik\Desktop\google music backup>movefromsubfolders
-D was unexpected at this time.

C:\Users\Erik\Desktop\google music backup>for /f "tokens=*" -D /s /b') do move "f" .

why is it screwing everything up? This is the first bat file i have ever attempted to write so i could possibly be doing something stupid

批量使用时,您需要加倍%

for /f "tokens=*" %%f in ('dir /a:-D /s /b') do move "%%f"

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