Saved Bookmarks
| 1. |
Solve : Batch Variable require for copying....? |
|
Answer» I NEED a Variable for DOS. I want to copy Links.txt to all drives in a time. What value did you plan on %alldrives% having? It might be easier to do each drive separately in a loop. I saved all in a batch. also changed my paths like this.... Code: [Select]for /f "tokens=3" %%i in ('echo list volume ^| diskpart ^| find /i "G:") do ( copy links.txt %%i:\ ) But not working...Sidewinder, a batch file like that is excessively strong magic for a novice, I think! Quote from: afzaldir on December 20, 2008, 11:15:59 PM
You "fixed" the wrong path.Not Understand Yet. also not working.... Please explain with code. [+path] I want copy links.txt G: and D: Code: [Select]for /f "tokens=3" %%i in ('echo list volume ^| diskpart ^| find /i "partition"') do ( copy links.txt %%i:\ ) that will copy the file links.txt to each visible logical drive. If you only wanted to copy to G: and D: Code: [Select]for %%p in (D G) do copy links.txt %%p: Or why not just do copy links.txt d:\ copy links.txt g:\ ? Oh come on now, that's too easy This work good: Code: [Select]for %%p in (A B 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 copy Links.txt %%p: But first Code is not working yet..... Thanks u all and special BC_Programmer |
|