Are you trying to just arbitrarily remove all of the users from different machines, or are you trying to create a list of users to remove then process based on that list?
Either way - this would be alot easier to code in Perl (especially if you alreay know PHP). Perl can be run from the command line and access any drives you have shared, can use arrays, hashes (associative arrays) and have powerful regexps (which in my opinion are easier to handle than PHP's so called PREGS). If all this is being done from one machine - through shares - this is definitely the way to go. Perl is fairly easy to install and get running on practically any system I can think of - you don't have to have a webserver installed for it to work (as alot of people seem to think)
If you're at a point where you're needing to manage multiple user accounts, perhaps you'd do well to set up a roving profiles server. You can set one up to work with any distribution of Windows (Well, 95, 98, 2K, ME, NT, XP - They can't do 3.x but I doubt you're using that anyway). They're best run on Linux (due to the lower overhead) and Linux can PDC for your domain and whatnot - giving you just one machine to handle all of your profiles and Logons. Windows NT, 2K and XP can also act as PDC's (it's built in) if you're not wanting to take the dive into Linux.
Roving profiles is what I do - doesn't mean you have to though. They allow a user to log in on any system on the domain with his/her credentials and all of their settings will follow them (Mail settings, desktop appearance, even menus if you configure that). The only drawback is that each machine will have to be configured for this, but you can broadcast the policy as a domain security policy and is should update all of the machines on the domain to the new settings (except Windows 95/98 - you have to do those manually - I think)
If this absolutely must be in DOS, you're going to have to set up tests to see if each folder is on in a list of folders you want to keep - which you'll have to create and import (for easy administration) or hard code into the BAT (for much easier coding). If you know the names of all the folders you want to keep - and they're going to be the same on each machine, you'd do better to hard code it. If you're going to want to be able to add "good" user folder that aren't to be deleted (and that change from time to time) you'd do better to import a list.
My DOS is too rusty to remember exactly how to do this, but I can tell you you're going to have to make extensive use of GOTO's and labels. I do most of my shell stuff in Perl these days (even in Windows).
http://www.disabo.com