Click here to Skip to main content
14,022,005 members
Rate this:
Please Sign up or sign in to vote.
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.

Updated 26-Jun-11 4:30am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web04 | 2.8.190417.4 | Last Updated 26 Jun 2011
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100