Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using windows explorer context "Copy as path" output causes ArgumentException #46

Closed
AGBrown opened this issue Feb 15, 2015 · 3 comments
Milestone

Comments

@AGBrown
Copy link
Contributor

AGBrown commented Feb 15, 2015

Windows explorer (since Win 7) provides the "copy as path" context menu command to get file path. However it encapsulates the file path on the clipboard with double quotes (e.g. "C:\path\to\my\file.txt"). This causes new FileInfo(txtMsiFileName.Text); in ReloadCurrentUIOnEnterKeyDown to throw an System.ArgumentException: Illegal characters in path., or the user has to do some tedious Home Delete End Backspace editing each time.

Purely in the spirit of nice UX it would be good to handle paths contained in double quotes, and catch some of the common path exceptions from typos. I've built a two-line fix for the first part at AGBrown/lessmsi/9d73c374 and handling some of the possible exceptions for bad paths at AGBrown/lessmsi/fa39baad. Pull request to follow.

@activescott
Copy link
Owner

Appreciate this Andrew! I will test this out and merge as soon as I have a minute free from work. It will probably be this weekend. Thanks for the PR !

On Feb 15, 2015, at 07:05, Andrew Brown [email protected] wrote:

Windows explorer (since Win 7) provides the "copy as path" context menu command to get file path. However it encapsulates the file path on the clipboard with double quotes (e.g. "C:\path\to\my\file.txt"). This causes new FileInfo(txtMsiFileName.Text); in ReloadCurrentUIOnEnterKeyDown to throw an System.ArgumentException: Illegal characters in path., or the user has to do some tedious Home Delete End Backspace editing each time.

Purely in the spirit of nice UX it would be good to handle paths contained in double quotes, and catch some of the common path exceptions from typos. I've built a two-line fix for the first part at AGBrown/lessmsi/9d73c374 and handling some of the possible exceptions for bad paths at AGBrown/lessmsi/fa39baad. Pull request to follow.


Reply to this email directly or view it on GitHub.

@AGBrown
Copy link
Contributor Author

AGBrown commented Feb 19, 2015

My pleasure Scott. It's a great little tool.
On Thu, Feb 19, 2015 at 8:38 am, scott willeke [email protected] wrote:Appreciate this Andrew! I will test this out and merge as soon as I have a minute free from work. It will probably be this weekend. Thanks for the PR !

On Feb 15, 2015, at 07:05, Andrew Brown [email protected] wrote:

Windows explorer (since Win 7) provides the "copy as path" context menu command to get file path. However it encapsulates the file path on the clipboard with double quotes (e.g. "C:\path\to\my\file.txt"). This causes new FileInfo(txtMsiFileName.Text); in ReloadCurrentUIOnEnterKeyDown to throw an System.ArgumentException: Illegal characters in path., or the user has to do some tedious Home Delete End Backspace editing each time.

Purely in the spirit of nice UX it would be good to handle paths contained in double quotes, and catch some of the common path exceptions from typos. I've built a two-line fix for the first part at AGBrown/lessmsi/9d73c374 and handling some of the possible exceptions for bad paths at AGBrown/lessmsi/fa39baad. Pull request to follow.


Reply to this email directly or view it on GitHub.

—Reply to this email directly or view it on GitHub.

@activescott activescott added this to the v1.3 milestone Mar 24, 2015
@activescott
Copy link
Owner

this was refactored a bit and merged. Thanks @AGBrown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants