I'm trying to transfer files to an AWS Snowball device using the Snowball client on my Windows workstation. However, I get the error "InvalidPathException-Trailing char < >". How can I fix this?

To resolve the "InvalidPathException-Trailing char < >" error, you must remove trailing spaces from the names of the files that you're trying to transfer. For more information on Windows file-naming conventions, see Naming Files, Paths, and Namespaces.

To remove trailing spaces, you can run this command in Windows PowerShell:

Get-ChildItem -recurse "* .*" -Path “path\to\directory” | Rename-Item –NewName { $_.name –Replace '\ \.','.' }

Note: This command removes one trailing space for each file name. If your file names have multiple trailing spaces, run the command multiple times until all trailing spaces are removed.

Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2019-02-12