Hi
I tried to search for the FOR usage
How to copy a set of files listed in FileList.txt using the FOR command both directly from the command prompt and from a batch file?
Are there any limitations in language, spaces etc in the file names contained in FileList.txt?
Thank you.
FOR usage to copy from list file
Moderator: DosItHelp
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: FOR usage to copy from list file
You'd want to use for /f for that. See FOR_F on SS64 for more.
In the command prompt
edited:
In a script (same thing, but %%A instead of %A)
In the command prompt
Code: Select all
for /f "delims=" %A in (FileList.txt) do (
copy "%A" "C:\path\to\wherever\you're\putting\them\and also this is in quotes because it's 2016 and people still put spaces in their paths\omg"
)
edited:
In a script (same thing, but %%A instead of %A)
Code: Select all
for /f "delims=" %%A in (FileList.txt) do (
copy "%%A" "C:\path\to\wherever\you're\putting\them\and also this is in quotes because it's 2016 and people still put spaces in their paths\omg"
)
Re: FOR usage to copy from list file
Thanks a lot !!!
I take it this "%A%" is a typo?
I take it this "%A%" is a typo?
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: FOR usage to copy from list file
What %A%?
%A (with one %) is used on the command prompt, %%A (with two consecutive %s) is used in scripts.
%A (with one %) is used on the command prompt, %%A (with two consecutive %s) is used in scripts.
Re: FOR usage to copy from list file
There was one there - a typo. The autocorrecting software on the Dostips forum fixed it.
Re: FOR usage to copy from list file
Thanks.
How can I mark this SOLVED?
How can I mark this SOLVED?