usebackq term
Moderator: DosItHelp
-
- Posts: 65
- Joined: 08 Jun 2012 07:48
usebackq term
Can someone please explain to me what the usebackq term means and what it's used for?
Re: usebackq term
"usebackq" is used to remove the double qoutes from arround a text in a for loop
have a look at this for loop:
see the <"C:\test.txt"> any thing between double qoutes is treated as a string so if you try this code it will display <C:\test.txt>
But if you add <usebackq> in the for loop
the <usebackq> will remove the double quotes around <C:\test.txt>, so the for loop will treat it as a location to the file test.txt in C:\ and will display the content of it.
I hope that clear enough
have a look at this for loop:
Code: Select all
for /f "tokens=* delims=" %%a in ("C:\test.txt") Do echo %%a
see the <"C:\test.txt"> any thing between double qoutes is treated as a string so if you try this code it will display <C:\test.txt>
But if you add <usebackq> in the for loop
Code: Select all
for /f "usebackq tokens=* delims=" %%a in ("C:\test.txt") Do echo %%a
the <usebackq> will remove the double quotes around <C:\test.txt>, so the for loop will treat it as a location to the file test.txt in C:\ and will display the content of it.
I hope that clear enough