Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
Greetings all,

First of all, let me apologize for newbingly not knowing where to address this question properly, as I'm somewhat "green" behind the ears when it comes to coding. I have a feeling that the answer to my question is very easy, but I'm tired of fighting it. A friend gave me a few basic batch/VB scripts a year ago, and I've been hooked on it ever since.

The issue I'm having revolves around a batch I've written to collect User profile data on retired workstations in our organization. These are all WinXP SP2 or SP#. I use it to copy over their data from: My Documents, Favorites, Microsoft/Signatures, Outlook profiles, and a few other locations to a backup server location.

The issue; How can I go about creating a variable list from the local C:\Documents and Settings\%Username% dir? I have it setup to run manually (as a SET /P %var%= ), which is fine, but some of these PC's have a lot (25+ profiles) on them. I'd like to create the list and loop the command to run the batch for each User profile.

My experience with Command-line is far greater than my VB experience, but I'm open to using/calling any script to accomplish this task.

Any help or advice is greatly appreciated, and if I need to elaborate more I will.

Thanks,
Posted
Updated 26-Jun-11 4:30am
v4

1 solution

You need to create script like this one.[^]. Go to section: Enumerating User Accounts on the Local Computer or Using WMI to Enumerate Local User Accounts

Running this script on local machine you'll get local accounts names. Changing piece of code, you'll will get full functionality of script.
 
Share this answer
 
v3
Comments
SCraw2855 16-Oct-11 9:59am    
Sorry I didn't accept this sooner.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900