Hi Experts! I've never done scripting in the Windows Shell before and I need some help.
Based on a .txt file I need to make a script that creates local groups but only creates a group if it doesn't already exist. I can create groups without a hitch, but I'm stuck on how to only make it if it doesn't exist part. The sample txt file I'm working with looks like this:
**************************************************************
New Employees
**************************************************************
LastName FirstName employeeID Department
--------------------------------------------------------------
Doe John A003 News
Smith Dave B005 Distribution
The code I have to create the group so far is this:
FOR /f "tokens=4 skip=6" %%a IN (HiredPersonnelTest.txt) DO NET LOCALGROUP %%a /add
Any help would be appreciated.
Thanks.
Washy
Our community of experts have been thoroughly vetted for their expertise and industry experience.