Jerold
Thu Dec 29 08:23:27 CST 2005
Here is a a begining:
@echo off
setlocal ENABLEDELAYEDEXPANSION
set pp=%ALLUSERSPROFILE%
set pp="%pp:\All Users=%"
set /a cnt=100
for /f "Tokens=*" %%u in ('dir /b /ad %pp%') do (
set /a cnt=!cnt! + 1
set wrk=%%u #
set line=!line![!cnt:~1,2!] !wrk:~0,35!
)
set /a max=%cnt% - 100
set /a cnt=0
for /L %%a in (1,1,%max%) do (
set /a pos=!cnt! * 40
set /a cnt=!cnt! + 1
call :xt !pos! "!line!"
)
endlocal
goto :EOF
:xt
set /a I=%1
set J=%2
set J=%J:"=%
call set pro=%%J:~%I%^,40%%
@echo %pro%
On Wed, 28 Dec 2005 23:11:02 -0800, "Frank" <Frank@discussions.microsoft.com> wrote:
>Hello Steven
>
>thanks for taking the time to answer.
>Unfortunately this isn't what I am looking for.
>
>1) I can not use a static script which pre defined user names as I am going
>to run the script manully on x number of PCs without knowing in advaced the #
>of profiles and their names.
>2) I therefore need a script than can run from a batch file which will check
>for the names of all available userprofiles on that PC following,
>regardingless if one or more partition and if the partions are active or not)
>and then return them as a Menu
>
>Sample:
>
>Found multiple UserProfiles on C:\
>Please choose which Userprofile you want to backup!
>Seperate UserProfiles with comma to backup multiple profiles at once
>
>1) Peter
>2) Paul
>3) Marry
>4) Adminstrator
>5) ...
>
>Each robocopy action I defined should be then perfomed based on the input
>
>Sample:
>
>If 1,2 was the choice
>It will copy Peter's and Paul's favorites
>
>If only 1 was the choice
>Only Peter's favorites will be backed up
>
>Sorry for the complicasted way to explain, but I am a stupid newbie.
>I am not a system admin, but at least know how to write "PC" and therefore I
>am in charge for all my friends and family and also some guys in the company.
>
>It happens about twive a week that someone crashes his "PC" (I call them
>"PORNO PC" as I am confident that most only crashes because of "funny" sites
>they are visiting.
>As I always have to copy all the files manually all the time, I want to
>speed up things.
>
>Why I am doing that? They "pay" with beer and dinner :)
>
>I would love to get this done a feel ashamed to ask for such specific
>things, but hopefully you can understand me better now and maybe you are able
>to provide a fool proof batch file for me that I can easiyl extend.
>
>I am in London wuite often and ofter you to "rebill me = beer and JAck
>Daniels Wings :)...in case you live close to London...
Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com