cmd - Reading text files with system variables by batch script? -
I have a text file param.txt that looks like the following:
"SaveOnExit", "true" "tmp_dir", "% tmp% \ app" "GUID", "ab0809eda345febca" I want to read this file through Win7 and File with a new "translated" system variable, for example
"SaveOnExit", "true", "tmp_dir", "C: \ users \ user \ AppData \ Local \ temp \ app" "" GUID "" Ab0809eda345febca "code here I have seen samples for parsing
@echo off for / f" tokens = 1 " %% g IN (Param.txt) DO @echo %% g Unfortunately Or is not being converted to system variable% temp% output remains the same as the original file. I played with SETLOCAL enabled extensions and enabledDelated Expansions without any consequences. As is possible to keep VBS as easy to use as possible, powers or additional equipment is not an option.
Is there a way to get output as a request? Thanks
@echo off setlocal enableextensions disabled (for / f "usebackq delims = "%% (in an" inputfile.txt ") (call apo (%% a))> gt; outputfile.txt expanding the variable reference inside the reading row You need to force it to parse, to process the contents of the variable. You can use the call command to force an asynchronous parse on the line to expand the variable. C can.
Comments
Post a Comment