mfrancke
Let me preface, I've only been in software packaging a couple years and that has been the breadth of my cmd experience.
This little bit is almost just an exercise for me so I can engage in a larger project soon after. I can't set an environmental variable to a line of a txt... depicted below. I was hoping to grab the contents of the second line of data from a file retrieved from a wmic query.
for /f "delims=" %a in (file.txt) do set var=%a
Was my reference>
What small stupid thing am I missing?
----------------------------
25 Nov 2015 23:59
Shadow Thief
I have figured out your problem!
You've saved file.txt as Unicode instead of ANSI. The command prompt doesn't play nice with Unicode (or UTF-8).
The simple solution is to save your text files with ANSI encoding when you're using Notepad.
----------------------------
#17 26 Nov 2015 06:46
foxidrive
Good sleuthing there Shadow Thief.Shadow Thief wrote:
You've saved file.txt as Unicode instead of ANSI.
This is going to be a similar headache because of wmic - not insurmountable but it's there.
mfrancke wrote:
I was hoping to grab the contents of the second line of data from a file retrieved from a wmic query.