Script to parse csv file and generate batch files
Posted on 2012-03-29
I have to create a set of batch files for various locations in our firm. The purpose of the batch files is to create a batch file that can be run to set system-level environment variables on systems.
Here is the CSV format:
I would like to have the script to read a line, in the CSV, and create a batch file with the following contents:
Once the bach file is created, I'd like to have the batch file copied to a server location. Once the copy is complete, the script should go to the next line and do the same thing at a different location until all locations are complete. The script needs to be flexible enough to add more columns in the future.
The reason I am creating these batch scripts is so I can use our desktop management suite to run the batch script on our systems. We cannot use login scripts because we need to have these settings set regardless of whether a user is logged in or not. Group policy is also not an option, at this moment.