Here I used USEBACKQ but didn't use double quotes around the file name.
Code: Select all
C:\BatchFiles\apostrophe>for /F "usebackq delims=" %G IN ('myfile.txt) do echo %G
C:\BatchFiles\apostrophe>echo LINE'1
LINE'1
The system cannot find the file ⨛✀谀潃卭数㵣㩃睜湩潤獷獜獹整㍭尲浣硥e.
Code: Select all
C:\BatchFiles\apostrophe>for /F "delims=" %G IN ('myfile.txt) do echo %G
C:\BatchFiles\apostrophe>echo LINE'1
LINE'1
The system cannot find the file ⨑─阀.
Code: Select all
C:\BatchFiles\apostrophe>for /F "usebackq delims=" %G IN ("'myfile.txt") do echo %G
C:\BatchFiles\apostrophe>echo LINE'1
LINE'1
Code: Select all
C:\BatchFiles\apostrophe>for /F "usebackq delims=" %G IN ('myfile.txt) do echo %G
C:\BatchFiles\apostrophe>echo LINE'1
LINE'1
The system cannot find the file ⨏⌀鐀单剅剐䙏䱉㵅㩃啜敳獲杜汣晪0.
C:\BatchFiles\apostrophe>for /F "usebackq delims=" %G IN ('myfile.txt) do echo %G
C:\BatchFiles\apostrophe>echo LINE'1
LINE'1
The system cannot find the file ⨔☀耀.
C:\BatchFiles\apostrophe>echo %errorlevel%
0