Looks like a logon script. The script calls some external cmd files which apparently set various variables which are then tested in the mainline script. Some of the variables (enclosed with %) are system environment variables (%systemroot%, %homedrive%, %homepath% etc) and some are generated by the external files (%_setpaths%, %rootdrive%, etc).
Without seeing the external files, it's difficult to see exactly what's happening but I'm guessing it just does some housekeeping for each user when they logon to their machine.
Did you have a specific question about this file? As for the meaning of the file, I'll leave that to the philosphers.