Hi Champs

I want to create a backup script which can be used when logged on but also
when booted with WinPE = profile not loaded.

Is there a way to display all available profiles on that machiene and to
choose from to have the choosen profile "added" in the placeholder of the
paths I specified in my script?

Sample:
I run the script and will then have the choice to choose from "Adminstrator"
or "User1" or "User2".

If I choose the "Administrator" profile, I want that the placeholder in all
related paths is taken for the operation:

Sample:

"%userprofile%\favorites\" becomes "C:\Documents and Settings\Favorites\"

Someone in here can follow me? :)

Re: <Else If> in command line by Steven

Steven
Wed Dec 28 16:48:55 CST 2005

Option Explicit
Dim sRet, sMsg
sRet = InputBox("Type a username")
sMsg = "You entered: "
Select Case LCase(sRet)
Case "administrator", "admin": WScript.Echo sMsg & sRet
Case "user1": WScript.Echo sMsg & sRet
Case "user2": WScript.Echo sMsg & sRet
Case Else: WScript.Echo "Woops, you made a boo boo"
End Select


--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

"Frank" <Frank@discussions.microsoft.com> wrote in message
news:10AE3AAF-18FB-4084-9F6D-EBA3117C84FD@microsoft.com...
> Hi Champs
>
> I want to create a backup script which can be used when logged on but also
> when booted with WinPE = profile not loaded.
>
> Is there a way to display all available profiles on that machiene and to
> choose from to have the choosen profile "added" in the placeholder of the
> paths I specified in my script?
>
> Sample:
> I run the script and will then have the choice to choose from
"Adminstrator"
> or "User1" or "User2".
>
> If I choose the "Administrator" profile, I want that the placeholder in
all
> related paths is taken for the operation:
>
> Sample:
>
> "%userprofile%\favorites\" becomes "C:\Documents and Settings\Favorites\"
>
> Someone in here can follow me? :)
>
>



Re: <Else If> in command line by Frank

Frank
Thu Dec 29 01:11:02 CST 2005

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


Re: Re: <Else If> in command line by Jerold

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

Re: Re: <Else If> in command line by Frank

Frank
Thu Dec 29 12:35:02 CST 2005

SO MANY THANKS!
This is a really great beginning:)

It works, I don't understand a single line, but it works :)
So I "Just" need to play around for the rest.

THANKS AGAIN!