Home All Groups Group Topic Archive Search About

script to copy user profile!!



Author
20 Apr 2007 10:30 PM
mcp
hello everyone,

i am migrating users from one domain to another and have decided to
manually copy user local profiles to new domain. im using admt to
migrate user accounts only to new domain nothing else..i have created
a script pasted below. when i run this script it makes all relevent
directories but dosn't copy any contents from user's directories.
whats missing help!!


thanks in advance.


@Echo on
C:
Cd\
MD Profile
CD Profile
MD PST
MD Favorites
MD Desktop
MD Docs
MD Cookie
Copy %userprofile%\desktop\*.* c:\profile\desktop\
Copy %userprofile%\Favorites\*.* c:\profile\Favorites\
Copy %userprofile%\local settings\application data\microsoft\outlook
\*.pst c:\profile\pst\
Copy %userprofile%\cookies\*.* c:\profile\cookies\

Author
21 Apr 2007 2:19 AM
Marty List
You should always enclose file paths in double quotes, in case it contains
spaces:
    Copy "%userprofile%\desktop\*.*" "c:\profile\desktop\"


Also, consider using XCopy:

xcopy /?
<snip>
  /S           Copies directories and subdirectories except empty ones.
  /H           Copies hidden and system files also.
  /K           Copies attributes. Normal Xcopy will reset read-only
attributes.
<snip>
  /EXCLUDE:file1[+file2][+file3]...
               Specifies a list of files containing strings.  Each string
               should be in a separate line in the files.  When any of the
               strings match any part of the absolute path of the file to be
               copied, that file will be excluded from being copied.  For
               example, specifying a string like \obj\ or .obj will exclude
               all files underneath the directory obj or all files with the
               .obj extension respectively.


Show quote
"mcp" <zafarhuss***@blueyonder.co.uk> wrote in message
news:1177108255.074204.174950@q75g2000hsh.googlegroups.com...
> hello everyone,
>
> i am migrating users from one domain to another and have decided to
> manually copy user local profiles to new domain. im using admt to
> migrate user accounts only to new domain nothing else..i have created
> a script pasted below. when i run this script it makes all relevent
> directories but dosn't copy any contents from user's directories.
> whats missing help!!
>
>
> thanks in advance.
>
>
> @Echo on
> C:
> Cd\
> MD Profile
> CD Profile
> MD PST
> MD Favorites
> MD Desktop
> MD Docs
> MD Cookie
> Copy %userprofile%\desktop\*.* c:\profile\desktop\
> Copy %userprofile%\Favorites\*.* c:\profile\Favorites\
> Copy %userprofile%\local settings\application data\microsoft\outlook
> \*.pst c:\profile\pst\
> Copy %userprofile%\cookies\*.* c:\profile\cookies\
>
Author
21 Apr 2007 4:44 PM
mcp
Show quote
On 21 Apr, 03:19, "Marty List" <use***@optimumx.com> wrote:
> You should always enclose file paths in double quotes, in case it contains
> spaces:
>     Copy "%userprofile%\desktop\*.*" "c:\profile\desktop\"
>
> Also, consider using XCopy:
>
> xcopy /?
> <snip>
>   /S           Copies directories and subdirectories except empty ones.
>   /H           Copies hidden and system files also.
>   /K           Copies attributes. Normal Xcopy will reset read-only
> attributes.
> <snip>
>   /EXCLUDE:file1[+file2][+file3]...
>                Specifies a list of files containing strings.  Each string
>                should be in a separate line in the files.  When any of the
>                strings match any part of the absolute path of the file to be
>                copied, that file will be excluded from being copied.  For
>                example, specifying a string like \obj\ or .obj will exclude
>                all files underneath the directory obj or all files with the
>                .obj extension respectively.
>
> "mcp" <zafarhuss***@blueyonder.co.uk> wrote in message
>
> news:1177108255.074204.174950@q75g2000hsh.googlegroups.com...
>
>
>
> > hello everyone,
>
> > i am migrating users from one domain to another and have decided to
> > manually copy user local profiles to new domain. im using admt to
> > migrate user accounts only to new domain nothing else..i have created
> > a script pasted below. when i run this script it makes all relevent
> > directories but dosn't copy any contents from user's directories.
> > whats missing help!!
>
> > thanks in advance.
>
> > @Echo on
> > C:
> > Cd\
> > MD Profile
> > CD Profile
> > MD PST
> > MD Favorites
> > MD Desktop
> > MD Docs
> > MD Cookie
> > Copy %userprofile%\desktop\*.* c:\profile\desktop\
> > Copy %userprofile%\Favorites\*.* c:\profile\Favorites\
> > Copy %userprofile%\local settings\application data\microsoft\outlook
> > \*.pst c:\profile\pst\
> > Copy %userprofile%\cookies\*.* c:\profile\cookies\- Hide quoted text -
>
> - Show quoted text -

hi thanks for you reply, but i have tried quotes and it still did not
work. please help..

thanks
Author
21 Apr 2007 5:07 PM
mcp
On 21 Apr, 17:44, mcp <zafarhuss***@blueyonder.co.uk> wrote:
Show quote
> On 21 Apr, 03:19, "Marty List" <use***@optimumx.com> wrote:
>
>
>
>
>
> > You should always enclose file paths in double quotes, in case it contains
> > spaces:
> >     Copy "%userprofile%\desktop\*.*" "c:\profile\desktop\"
>
> > Also, consider using XCopy:
>
> > xcopy /?
> > <snip>
> >   /S           Copies directories and subdirectories except empty ones.
> >   /H           Copies hidden and system files also.
> >   /K           Copies attributes. Normal Xcopy will reset read-only
> > attributes.
> > <snip>
> >   /EXCLUDE:file1[+file2][+file3]...
> >                Specifies a list of files containing strings.  Each string
> >                should be in a separate line in the files.  When any of the
> >                strings match any part of the absolute path of the file to be
> >                copied, that file will be excluded from being copied.  For
> >                example, specifying a string like \obj\ or .obj will exclude
> >                all files underneath the directory obj or all files with the
> >                .obj extension respectively.
>
> > "mcp" <zafarhuss***@blueyonder.co.uk> wrote in message
>
> >news:1177108255.074204.174950@q75g2000hsh.googlegroups.com...
>
> > > hello everyone,
>
> > > i am migrating users from one domain to another and have decided to
> > > manually copy user local profiles to new domain. im using admt to
> > > migrate user accounts only to new domain nothing else..i have created
> > > a script pasted below. when i run this script it makes all relevent
> > > directories but dosn't copy any contents from user's directories.
> > > whats missing help!!
>
> > > thanks in advance.
>
> > > @Echo on
> > > C:
> > > Cd\
> > > MD Profile
> > > CD Profile
> > > MD PST
> > > MD Favorites
> > > MD Desktop
> > > MD Docs
> > > MD Cookie
> > > Copy %userprofile%\desktop\*.* c:\profile\desktop\
> > > Copy %userprofile%\Favorites\*.* c:\profile\Favorites\
> > > Copy %userprofile%\local settings\application data\microsoft\outlook
> > > \*.pst c:\profile\pst\
> > > Copy %userprofile%\cookies\*.* c:\profile\cookies\- Hide quoted text -
>
> > - Show quoted text -
>
> hi thanks for you reply, but i have tried quotes and it still did not
> work. please help..
>
> thanks- Hide quoted text -
>
> - Show quoted text -

sorry my apology it works on Favourite, desktop, and .Pst, but not the
doc's and Cookies. Please help i have pasted the exact script..

@Echo on

C:

Cd\

MD Profile

CD Profile

MD PST

MD Favorites

MD Desktop

MD Docs

MD Cookie

Copy "%userprofile%\desktop\*.*" "c:\profile\desktop\"

Copy "%userprofile%\Favorites\*.*" "c:\profile\Favorites\"

Copy "%userprofile%\local settings\application data\microsoft\outlook
\*.pst" "c:\profile\pst\"

copy "%userprofile%\My Documents\*.*" "c:\profile\Docs\"

Copy "%userprofile%\cookies\*.*" "c:\profile\cookies\"

Thanks
Author
22 Apr 2007 2:18 AM
Marty List
"mcp" <zafarhuss***@blueyonder.co.uk> wrote in message
news:1177175279.254939.223860@q75g2000hsh.googlegroups.com...
>
> sorry my apology it works on Favourite, desktop, and .Pst, but not the
> doc's and Cookies. Please help i have pasted the exact script..
>

Why don't you give more details? Say something more helpful than just it's
not working.  Are you saying the COPY command gives no errors, yet no files
are copied?  That would mean either there are no files in that folder, or
they are hidden.

Which operating systems do you need this script to work on?
Author
22 Apr 2007 2:41 AM
Michael Harris (MVP)
Show quote
> sorry my apology it works on Favourite, desktop, and .Pst, but not the
> doc's and Cookies. Please help i have pasted the exact script..
>
> @Echo on
>
> C:
>
> Cd\
>
> MD Profile
>
> CD Profile
>
> MD PST
>
> MD Favorites
>
> MD Desktop
>
> MD Docs
>
> MD Cookie

You MD Cookie (singular) but later copy to cookies (plural).  Other than
that I don't see anything else syntactically wrong...

Show quote
>
> Copy "%userprofile%\desktop\*.*" "c:\profile\desktop\"
>
> Copy "%userprofile%\Favorites\*.*" "c:\profile\Favorites\"
>
> Copy "%userprofile%\local settings\application data\microsoft\outlook
> \*.pst" "c:\profile\pst\"
>
> copy "%userprofile%\My Documents\*.*" "c:\profile\Docs\"
>
> Copy "%userprofile%\cookies\*.*" "c:\profile\cookies\"

--
Michael Harris
Microsoft.MVP.Scripting

AddThis Social Bookmark Button