Alright, the code examples are long, but I'm showing different results here. I have no idea why it's doing what it's doing, but as you can see, I declare my source, destination, file exception, and directory exception variables with the $username variable implanted in it. In this example, the first time I mistakenly forgot to assign anything to the $username variable, so it's blank. When I run Robocopy using the variable references, it comes up right (note the source, destination, and excludes). I then go back and properly assign the username to the $username variable and try again, but it goes all crazy when my username is in there.
Any thoughts or suggestions are welcome.
$source2 = "C:\old harddrive\documents and settings\$username\" $dest2 = "C:\users\$username\" $filexc2 = @("C:\old harddrive\documents and settings\$username\ntuser.dat") $direxc2 = @("C:\old harddrive\documents and settings\$username\cookies", "C:\old harddrive\documents and settings\$username\start menu", "C:\old harddrive\documents and settings\$username\local settings", "C:\old harddrive\documents and settings\$username\application data", "C:\old harddrive\documents and settings\$username\appdata") ____________________________________________________________________________________ $source2 $dest2 $filexc2 $direxc2 C:\old harddrive\documents and settings\\ C:\users\\ C:\old harddrive\documents and settings\\ntuser.dat C:\old harddrive\documents and settings\\cookies C:\old harddrive\documents and settings\\start menu C:\old harddrive\documents and settings\\local settings C:\old harddrive\documents and settings\\application data C:\old harddrive\documents and settings\\appdata ____________________________________________________________________________________ $Username = [Environment]::username ____________________________________________________________________________________ ROBOCOPY $source2 $dest2 /COPYALL /E /xd $direxc2 /xf $filexc2 /R:0 /Z
/log+:datatransfer.log /tee /FP /MT:8
Log File : E:\New Lease Replacement Method\3. New Machine\datatransfer.log
------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows -------------------------------------------------------------------------------
Started : Thu Sep 02 14:45:15 2010
Source : C:\old harddrive\documents and settings\ Dest : C:\users\
Files : *.* Exc Files : C:\old harddrive\documents and settings\\ntuser.dat Exc Dirs : C:\old harddrive\documents and settings\\cookies C:\old harddrive\documents and settings\\start menu C:\old harddrive\documents and settings\\local settings C:\old harddrive\documents and settings\\application data C:\old harddrive\documents and settings\\appdata Options : *.* /FP /TEE /S /E /COPYALL /Z /MT:8 /R:0 /W:30
------------------------------------------------------------------------------ ____________________________________________________________________________________ $source2 = "C:\old harddrive\documents and settings\$username\" $dest2 = "C:\users\$username\" $filexc2 = @("C:\old harddrive\documents and settings\$username\ntuser.dat") $direxc2 = @("C:\old harddrive\documents and settings\$username\cookies", "C:\old harddrive\documents and settings\$username\start menu", "C:\old harddrive\documents and settings\$username\local settings", "C:\old harddrive\documents and settings\$username\application data", "C:\old harddrive\documents and settings\$username\appdata") ____________________________________________________________________________________ $source2 $dest2 $filexc2 $direxc2 C:\old harddrive\documents and settings\mmoore3\ C:\users\mmoore3\ C:\old harddrive\documents and settings\mmoore3\ntuser.dat C:\old harddrive\documents and settings\mmoore3\cookies C:\old harddrive\documents and settings\mmoore3\start menu C:\old harddrive\documents and settings\mmoore3\local settings C:\old harddrive\documents and settings\mmoore3\application data C:\old harddrive\documents and settings\mmoore3\appdata ____________________________________________________________________________________ ROBOCOPY $source2 $dest2 /COPYALL /E /xd $direxc2 /xf $filexc2 /R:0 /Z
/log+:datatransfer.log /tee /FP /MT:8
------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows -------------------------------------------------------------------------------
Started : Thu Sep 02 14:46:33 2010
Source - C:\old harddrive\documents and settings\mmoore3" C:\users\mmoore3\ \COPYALL \E \xd C:\old\ Dest - E:\New Lease Replacement Method\3. New Machine\harddrive\documents\
Files : and Options : /COPY:DAT /R:1000000 /W:30 ------------------------------------------------------------------------------ ERROR : Invalid Parameter #4 : "settings\mmoore3\cookies C:\old"
|