cancel
Showing results for 
Search instead for 
Did you mean: 

Failed .eml files

trpe71
Level 4

Hello,

I have a large number of failed .EML SMTP items to re-run but moving them folder by folder manually to an upcoming folderfor processing will take days since it is every minute for 3 days, does anyone by chance have a robocopy or xcopy script that will move only the files and not the folders? I have been messing with this but have not found the right switch to omit moving over the folders and have this so far but it also copies the folders, something that searches out only .eml files would be great then it could run from the root. Any info on this would be very appreciated

Testing this ---Robocopy "W:\test source" "V:\test dest" /s /mov /xd

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

ChrisLangevin
Level 6
Employee

One easy way to do this is with PowerShell:

Get-ChildItem -Path "W:\test source" -Recurse -File -Filter "*.eml" | Move-Item -Destination "V:\test dest" 

This recurses the source directory, pulls out all the files of type .eml from the subfolders, and dumps them all into the single destination directory you choose.

You can also substitute the Copy-Item cmdlet if you'd like to leave the original in place.

 

--Chris

View solution in original post

7 REPLIES 7

GertjanA
Moderator
Moderator
Partner    VIP    Accredited Certified

Hello (again).

I've been in the same, although not for having items for days, just a few.

I've been playing with robocopy also, but have not been able to get it to do what I wanted it to do. In RC, you can use "file *.eml" to define just these files, but the goal is to move files from all those subfolders into 1 folder in the holdingfolder.

I (still) do this manually, moving the items first into a temp folder, then find the next folder to be processed, then move the lot into that folder. Having EML items for days in the failed items folder, is hard to do. I'm sorry I cannot offer you the solution. As remark, I have listed this as 'need someway to be handled' in the EV application. It is under investigation currently. You might want to bring this to attention to your SE/Sales person, who needs to relay this to engineering. (get a setting in EV which will automatically move SMTP items from the Failed folder back to a folder which is going to be processed)

Regards. Gertjan

Hi Gertjan,

Thank you for the reply! I have done a bunch manually but was hoping to have a magic bullet to speed things up, it is great that you have already got the ball rolling for Veritas to get a fix in place as this can really be a pain. In my case I came back from a couple days off and found the failed items, fun!! :) Back to manual unless some other ideas pop up.

 

Thanks!

ChrisLangevin
Level 6
Employee

One easy way to do this is with PowerShell:

Get-ChildItem -Path "W:\test source" -Recurse -File -Filter "*.eml" | Move-Item -Destination "V:\test dest" 

This recurses the source directory, pulls out all the files of type .eml from the subfolders, and dumps them all into the single destination directory you choose.

You can also substitute the Copy-Item cmdlet if you'd like to leave the original in place.

 

--Chris

GertjanA
Moderator
Moderator
Partner    VIP    Accredited Certified

Hi Chris,

I can only give one kudo, you deserver more. Thanks!

Regards. Gertjan

Hi Chris,

Thank you very much for helping with this, I know it has been an issue for a bunch of people.

I ran the script and got this, any suggestions, sorry my powershell experience is limited?

Thanks!

Get-ChildItem : A parameter cannot be found that matches parameter name 'File'.
At C:\ps1\emlmove.ps1:1 char:52
+ Get-ChildItem -Path "W:\test source" -Recurse -File <<<< -Filter "*.eml" | Move-Item -Destination "V:\test dest"
+ CategoryInfo : InvalidArgument: (:) [Get-ChildItem], ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand

Any chance you're running this on Windows 2008 R2? If you are and you have never updated PowerShell on it, then you will be running PS v2.0, which doesn't include the -File parameter on the Get-ChildItem cmdlet. That parameter was added in PS v3.0, which shipped with Windows 2012.

Here is the download you need to to upgrade to a modern version of PS on an older version of Windows.

--Chris

Hey Chris,

Thank you, I am on 2008 R2. I will download that and give it a go.

 

Regards,