Skip to main content

show_properties

Function show_properties 

Source
pub fn show_properties(target: impl AsRef<Path>) -> Result<()>
Expand description

Opens the Windows Properties sheet for a file or directory.

This is a convenience wrapper around open_with_verb using the properties shell verb.

§Errors

Returns Error::InvalidInput if target is empty or contains NUL bytes. Returns Error::PathDoesNotExist if the target path does not exist. Returns Error::WindowsApi if ShellExecuteW reports failure.

§Examples

win_desktop_utils::show_properties(r"C:\Windows\notepad.exe")?;
Examples found in repository?
examples/open.rs (line 2)
1fn main() -> Result<(), win_desktop_utils::Error> {
2    win_desktop_utils::show_properties(r"C:\Windows\notepad.exe")?;
3    win_desktop_utils::open_containing_folder(r"C:\Windows\notepad.exe")?;
4    win_desktop_utils::open_url(" https://www.rust-lang.org ")?;
5    Ok(())
6}