On the command line, not one-line, but as a batch file, the following works for me:
>>output.txt ( echo|set/p=""" )
Or, if you want to press return to write it, use the following, very similar:
>>output.txt ( set /p=""" < nul )
You can also set it as a function for dynamic use:
>>"%~dp1" ( echo|set/p=""" )
To use this, you pass the file name as the first command line argument as follows:
addQuoteTo.bat "C: \ my Path \ toFile \ file.txt"
It was interesting to play with :)
source share