I am trying to retrieve the data from user groups and exporting it into an excel. So i am able to get the users etc into a text file, but converting them to excel has to be manual(open text file in excel, then do the text import wizard and selecting comma as the deliminator). Is there a way to automate the process whereby using a batch file, i can export the data into an excel with the deliminator already specified? This is my code for retrieving the user groups(quite an easy code)
start wmic /output:C:\Users\John\Desktop\automation\useraccounts.txt useraccount list full /format:csv
END
If i tried to export it to useraccounts.csv, all the data will be in the first column only.