![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Moving folders (including files) based to folder name Hi, I am trying to move some 2007 data which is stored in the following folder naming format: 01-Aug-2007 to a central Archive2007 folder. I have the following script: dir "v:\UXP VRC" | Where-Object { $_.Name -like "*-*-2007" } | Move- Item -Destination v:\Archive2007 but I get the following error when running the script: WARNING: Access to the path 'V:\UXP VRC\11-Oct-2007' is denied. (This appears for all folders) I can drag and drop without any issues. Thanks in advance. Giles Ogram |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Moving folders (including files) based to folder name Adding to Marco, try to add -force. I would test it first on a test folder, make a copy of one directory and try to move that directory only with the -force parameter, there may be some read only files inside. BTW, you can make it shorter: move-item "v:\UXP VRC\*-*-2007" -dest v:\Archive2007 -force --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic Quote: > Hi, > I am trying to move some 2007 data which is stored in the following > folder naming format: > 01-Aug-2007 > to a central Archive2007 folder. > I have the following script: > dir "v:\UXP VRC" | Where-Object { $_.Name -like "*-*-2007" } | Move- > Item -Destination v:\Archive2007 > > but I get the following error when running the script: > > WARNING: Access to the path 'V:\UXP VRC\11-Oct-2007' is denied. (This > appears for all folders) > > I can drag and drop without any issues. > Thanks in advance. > Giles Ogram |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Moving files from one directory to another based on the file namecontains specified string by using vbscript | VB Script | |||
| vista leaves behind folders when moving folders with files in them | Vista General | |||
| Re: Moving files based on filesize | PowerShell | |||
| Deleteing Files in a folder based on date! | Vista file management | |||
| When moving folders original folder is not deleted | Vista General | |||