Discussion:
script to copy user profile!!
(too old to reply)
mcp
2007-04-20 22:30:55 UTC
Permalink
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\
Marty List
2007-04-21 02:19:36 UTC
Permalink
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.
Post by 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
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\
mcp
2007-04-21 16:44:00 UTC
Permalink
Post by Marty List
You should always enclose file paths in double quotes, in case it contains
Copy "%userprofile%\desktop\*.*" "c:\profile\desktop\"
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.
Post by 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
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
mcp
2007-04-21 17:07:59 UTC
Permalink
Post by mcp
Post by Marty List
You should always enclose file paths in double quotes, in case it contains
Copy "%userprofile%\desktop\*.*" "c:\profile\desktop\"
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.
Post by 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
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
Marty List
2007-04-22 02:18:49 UTC
Permalink
Post by mcp
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?
Michael Harris (MVP)
2007-04-22 02:41:43 UTC
Permalink
Post by mcp
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
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...
Post by mcp
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
Mohammad Abdul Kader
2010-10-16 21:08:41 UTC
Permalink
The batch BackupMe is an automated user profile backing up solution for Windows. I created this tools using DOS Script & for smooth use I have used some other tools like VB Script. But the Base of the tools is Shell Script. Modification is allowed for this tools for personal use.

For details visit [url=http://techsolutionpoint.blogspot.com/2010/10/backupme-freeware-backing-up-solution.html]Techno Solution Point: BackupMe ? The freeware backing up solution for Windows Profile.[/url]. You can also visit the product's home page from the link [url=http://techsolutionpoint.blogspot.com/p/backupme.html]Techno Solution Point: BackupMe[/url]. It is Free.
Post by 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
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\
Post by Marty List
You should always enclose file paths in double quotes, in case it contains
Copy "%userprofile%\desktop\*.*" "c:\profile\desktop\"
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.
Post by mcp
hi thanks for you reply, but i have tried quotes and it still did not
work. please help..
thanks
Post by mcp
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
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
Post by Marty List
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?
Post by Michael Harris (MVP)
You MD Cookie (singular) but later copy to cookies (plural). Other than
that I do not see anything else syntactically wrong...
--
Michael Harris
Microsoft.MVP.Scripting
Submitted via EggHeadCafe - Software Developer Portal of Choice
ASP.NET MaskedTextBox Custom Control
http://www.eggheadcafe.com/tutorials/aspnet/39a071cd-9f96-4e81-9346-4e445181d645/aspnet-maskedtextbox-custom-control.aspx
Loading...