使用用户帐户名填充变量列表 [英] Populating a list of variables with User account names

查看:108
本文介绍了使用用户帐户名填充变量列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候所有,

首先,对于我不知道该在哪里正确解决这个问题,我深表歉意,因为在编码方面我有些绿".我觉得我的问题的答案很容易,但是我厌倦了与之抗争.一年前,一个朋友给了我一些基本的批处理/VB脚本,从那时起我就迷上了它.

我遇到的这个问题与我为在我们组织中的退休工作站上收集用户配置文件数据而编写的批处理有关.这些都是WinXP SP2或SP#.我用它来将其数据从以下位置复制:我的文档,收藏夹,Microsoft/签名,Outlook配置文件以及其他一些位置到备份服务器位置.

问题;如何从本地C:\ Documents and Settings \%Username%目录创建变量列表?我将其设置为手动运行(作为SET/P%var%=),这很好,但是其中一些PC上有很多(25个以上的配置文件).我想创建列表并循环执行命令以针对每个用户配置文件运行批处理.

我在命令行方面的经验远超过我在VB方面的经验,但是我愿意使用/调用任何脚本来完成此任务.

任何帮助或建议,我们将不胜感激,如果我需要详细说明,我会提供.

谢谢,

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,

推荐答案

您需要创建类似 ^ ].转到部分:枚举本地计算机上的用户帐户使用WMI枚举本地用户帐户

在本地计算机上运行此脚本,您将获得本地帐户名称.更改一段代码,您将获得脚本的全部功能.
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.


这篇关于使用用户帐户名填充变量列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆