|
On the file and print machine I have created a directory called migration. The directory migration is shared with full share rights for everyone. Its NTFS rights are for Authenticated Users everything but full control. Each user has a directory in the Migration folder named after their userid. In each users directory are things they want saved. My Documents, favorites, and archived mail in archmail. When the user logs in the script is run. It completes the first copy command with a error code of 0, but nothing is copied to the users My Documents directory in their roaming profile. It stops there and does not complete and does not error out. Any help? Thanks in advance
; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ; This script copies all of the My Documents, Favorites and ArchMail directories of each user down to their ; redirected directory, profile directory and h: or arcmail directory. v0.1 ; \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
$totalmoved = 0 ; used to count how many directoies are moved ; Copies the users my documents. If else is error checking. Copy "\\fileandprint\Migration\" + @USERID + "\My Documents\" "\\fileandprint\Redirected$\" + @USERID + "\My Documents\" /s IF @error = 0 ? @fullname + "'s My Documents folder was copied to \\fileandprint\Redirected$\" + @USERID + "\" $totalmoved = $totalmoved + 1 ELSE ? "Could not copy" + @fullname + "'s My Documents folder to \\fileandprint\Redirected$\" + @USERID + "\" ? "System Error Code [" + @error + "]" ? "Press any key to continue." GET $key
; Copies the users favorites. If else is error checking. Copy "\\fileandprint\Migration\" + @USERID + "\Favorites\" "\\fileandprint\profiles$\" + @USERID + "\Favorites\" /s IF @error = 0 ? @fullname + "'s Favorites were copied to \\fileandprint\profiles$\" + @USERID + "\Favorites" $totalmoved = $totalmoved + 1 ELSE ? "Could not copy" + @fullname + "'s Favorites to \\fileandprint\profiles$\" + @USERID + "\Favorites" ? "System Error Code [" + @error + "]" ? "Press any key to continue." GET $key
; Copies the users archived mail. If else is error checking. Copy "\\fileandprint\Migration\" + @USERID + "\ArchMail\" "\\fileandprint\Arcmail$\" + @USERID + "\" /s IF @error = 0 ? @fullname + "'s archived mail was copied to \\fileandprint\Arcmail$\" + @USERID + "\" $totalmoved = $totalmoved + 1 ELSE ? "Could not copy" + @fullname + "'s archived mail to \\fileandprint\Arcmail$\" + @USERID + "\" ? "System Error Code [" + @error + "]" ? "Press any key to continue." GET $key
; If total moved equals the number of folders moved then the direcory under migration will be ; renamed to @useridMOVED IF $totalmoved = 3 ? "Completely migrated " + @FULLNAME + "." MOVE "\\fileandprint\Migration\" + @USERID + "\" "\\fileandprint\Migration\" + @USERID + "MOVED\" ELSE ? "There were errors when moving " + @FULLNAME + ". Only copied " + $totalmoved + " directories." ? "Press any key to continue." GET $key
|