Click here to Skip to main content
Sign Up to vote bad
good
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 26 Jun '11 - 4:15
SCraw28551.4K
Edited 26 Jun '11 - 4:30


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.
  Permalink  
Comments
SCraw2855 - 16 Oct '11 - 9:59
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
Your Filters
Interested
Ignored
     
0 OriginalGriff 286
1 Mohammed Hameed 208
2 Sergey Alexandrovich Kryukov 188
3 Santhosh G_ 108
4 Mayur_Panchal 98
0 Sergey Alexandrovich Kryukov 8,216
1 OriginalGriff 6,271
2 CPallini 3,528
3 Rohan Leuva 2,703
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 26 Jun 2011
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid