0

For some when I run this command in PowerShell, it succeeds up to a certain point:

Copy-Item  S:\schools\$question C:\Users\$env:username\Desktop\schools\$question -Recurse -Verbose

Integrated with my current script, this line takes the files from S:\schools\$question and copies them to C:\Users\$env:username\Desktop\schools\$question. This works fine on some folders, and then just stops running on other ones. On the one's that it stops running on, PowerShell seems to be using 50% of my CPU resources, whitch should never happen as I'm just copying files.

Again, as always, any assistance is greatly appreciated.

Matt Bettiol
  • 309
  • 1
  • 3
  • 9
  • Please include any files/folder names on the one that it seems to be hanging on. Possible issues could be because the path is too long (i.e. 260+ chars). or that the file contains special characters (i.e. $) – HAL9256 Feb 24 '14 at 19:57
  • There are no special characters in the file, or file name. I tried copying a folder named /r/ to C:\Users\$env:username\Desktop\schools\$question and it still didn't work. Stopped running at C:\Users\bettiom\Desktop\schools\r\images\resources\Thumbs.db – Matt Bettiol Feb 24 '14 at 20:34
  • Two thoughts. First has a module installed a proxy function for Copy-Item? Run `Get-Command Copy-Item | fl *` to see if its the command from `Microsoft.PowerShell.Management`. Second, how does robocopy behave with these dirs? – Keith Hill Feb 24 '14 at 21:02
  • Agree with Keith - try RoboCopy, you'll get more feedback. Another thought would be permissions. Files under C:\Users\... are typically protected. Does your script run with necessary Admin rights? – andyb Feb 24 '14 at 23:09
  • Long story short, I'll have to test these things out on Wednesday. Thanks for the feedback, guys. And yes, I have the necessary permissions to copy/modify all these files/folders. – Matt Bettiol Feb 25 '14 at 03:00

0 Answers0