#43261 - 2003-07-23 10:17 PM
copying directories from unc path to unc path
|
keys
Fresh Scripter
Registered: 2003-07-22
Posts: 13
|
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
|
|
Top
|
|
|
|
#43263 - 2003-07-23 10:38 PM
Re: copying directories from unc path to unc path
|
keys
Fresh Scripter
Registered: 2003-07-22
Posts: 13
|
Stupid me. Thanks for looking that over. When I tested it it didn't complain about the missing ENDIF. I guess i didn't get that far when running. I read the manual about the strings. I have a question. $variable = 2 Is 1) ? "Print out this variable: " + $variable output: "Print out this variable: 2 the same as 2) ? "Print out this variable: $$variable" output?: "Print out this variable: $variable." Am i correct on this. Thanks again
|
|
Top
|
|
|
|
#43265 - 2003-07-24 09:58 PM
Re: copying directories from unc path to unc path
|
keys
Fresh Scripter
Registered: 2003-07-22
Posts: 13
|
Thanks for the help. I got it working. It was just some simple coding errors on my part. I was calling $variable = unc path $variable2 = another unc path COPY "$varaible" "$variable2" /s when I should have been calling it like: COPY $variable $variable2 /s Just like you said with the strings.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1057 anonymous users online.
|
|
|