From 95417f9e46e6541a3aca97bd84ebd221237b7628 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 14:51:12 -0500 Subject: [PATCH] docs: document that `shell.trashItem` requires backslashes (#49481) docs: Update shell.md: Document that shell.trashItem requires backslashes In Windows many functions relating to files (e.g. shell.openItem, the Node fs functions, as well as native Win32 APIs) will accept either type of slash / or \ as a folder separator. shell.trashItem does not work with / as folder separator in Windows. This documentation change explains that. See also: https://github.com/electron/electron/issues/28831 Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: sam marshall --- docs/api/shell.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/api/shell.md b/docs/api/shell.md index 59bb0c19dd..07f32c73fe 100644 --- a/docs/api/shell.md +++ b/docs/api/shell.md @@ -86,6 +86,10 @@ Rejects if there was an error while deleting the requested item. This moves a path to the OS-specific trash location (Trash on macOS, Recycle Bin on Windows, and a desktop-environment-specific location on Linux). +The path must use the default path separator for the platform (backslash on +Windows). Use `path.resolve()` from the `node:path` module to ensure correct +handling on all filesystems. + ### `shell.beep()` Play the beep sound.