|
|
|||||||
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: 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. |
||||||||
|
|
|||||||
My guess is it has to do with privileges. By default nobody but the profile owner has privileges to even access the folder where the profile is stored on the server. As a side note: roaming profiles s#uck but that’s just my opinion |
||||||||
|
|
|||||||
I would think as a Domain Admin I would have rights. If I leave out the 2nd, 3rd, and 4th Copy lines, it works how it's supposed to. |
||||||||
|
|
|||||||
in your destination you have 'servername' for the servername is that really the server name? |
||||||||
|
|
|||||||
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" |
||||||||
|
|
|||||||
I'm not really moving it anywhere. I'm just renaming it. If I do a "\\" + $server + "\profiles$\" + $userid "\\" + $server + "\\profiles$\" + $userid + ".old" It actually renames dstelz to dstelz.old which is what I want it to do. Then when I want to copy the contents of the temp folder to basically a new folder called dstelz, it creates the folder, but it won't copy the data over. |
||||||||
|
|
|||||||
I think the coloured hack is redundant: Move "\\" + $server + "\profiles$\" + $userid "\\" + $server + "\\profiles$\" + $userid + ".old" |
||||||||
|
|
|||||||
Wow, I love wasting hours on syntax mistakes. Thanks Witto. |
||||||||
|
|
|||||||
good eye Witto, you da man |
||||||||
|
|
|||||||
Originally Posted By: DStelz I would think as a Domain Admin I would have rights. If I leave out the 2nd, 3rd, and 4th Copy lines, it works how it's supposed to. That was my first thought when I started at my current job. We used roaming profiles then but now we all have local profiles. By default nobody but the profile owner has access to the folder so unless you or someone else changed the permissions even a domain admin cannot access the folder. |