lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi all,
         I don't know, this is the right place to post this question.

I want the output of any wmic  command to be saved in the table. For other commands I don't have any problem. After running the below script if I watch files table value I could see "Improperly formatted XML Data" Please suggest me on this regard.

local files = {}
   out = os.execute('wmic process get  > F:\\wmiclog.txt' )
file = assert("F:\\wmiclog.txt", "r"))
   local f ='F:\\wmiclog.txt')
   if not f then return files end 
   local k = 1
   for line in f:lines() do
      files[k] = line
      k = k + 1

Thanks & Regards,