#175669 - 2007-04-25 04:39 PM
Copy/Move Problem
|
DStelz
Getting the hang of it
Registered: 2007-01-26
Posts: 72
Loc: Green Bay, WI
|
I am trying to do a simple script for us to use if we need to replace a corrupt XP profile. For some reason the final copy doesn't work and returns an error code 3. I've broken it up and it works in parts, but when the whole thing is together it will not copy the folders to the directory. Here is the code:
$SO=SETOPTION("Explicit", "ON")
$SO=SETOPTION("NoMacrosInStrings", "ON")
$SO=SETOPTION("NoVarsInStrings", "ON")
BREAK ON
DIM $userid
DIM $server
DIM $dir
"Enter user id:" Gets $userid
"Enter server name:" Gets $server
$dir = "\\" + $server + "\profiles$\" + $userid + "\"
Copy "\\" + $server + "\profiles$\" + $userid + "\Favorites\" "\\servername\apps$\kixtart\temp\Favorites\" /s
Copy "\\" + $server + "\profiles$\" + $userid + "\Desktop\" "\\servername\apps$\kixtart\temp\Desktop\"
Copy "\\" + $server + "\profiles$\" + $userid + "\application data\microsoft\outlook\*.*nk2" "\\servername\apps$\kixtart\temp\outlook\"
Copy "\\" + $server + "\profiles$\" + $userid + "\Application Data\Microsoft\Internet Explorer\Quick Launch\" "\\servername\apps$\kixtart\temp\quick\"
Move "\\" + $server + "\profiles$\" + $userid "\\" + $server + "\\profiles$\" + $userid + ".old"
Copy "\\servername\apps$\kixtart\temp\" $dir /s
It just copies certain folders to a temp folder, renames the profile and then copies the files from the temp folder to the new profiles directory.
If you have any questions, let me know.
|
Top
|
|
|
|
#175685 - 2007-04-25 08:48 PM
Re: Copy/Move Problem
[Re: DStelz]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
in your destination you have 'servername' for the servername is that really the server name?
|
Top
|
|
|
|
#175686 - 2007-04-25 08:55 PM
Re: Copy/Move Problem
[Re: Benny69]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
in the move command: Move "\\" + $server + "\profiles$\" + $userid "\\" + $server + "\\profiles$\" + $userid + ".old"
you have a sorce but the destination needs to be seperated Move "\\" + $server + "\profiles$\" + $userid + "" "\\" + $server + "\\profiles$\" + $userid + ".old" "DESTINATION"
|
Top
|
|
|
|
#175697 - 2007-04-26 01:14 AM
Re: Copy/Move Problem
[Re: DStelz]
|
Benny69
Moderator
Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
|
good eye Witto, you da man
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 515 anonymous users online.
|
|
|