Move item to trash without confirming on Windows
authorMark Samman <mark.samman@gmail.com>
Wed, 2 Jul 2014 01:55:29 +0000 (03:55 +0200)
committerMark Samman <mark.samman@gmail.com>
Wed, 2 Jul 2014 01:55:29 +0000 (03:55 +0200)
This will skip the "Are you sure you want to move this file to the Recycle Bin?" dialog on Windows.

atom/common/platform_util_win.cc

index 6c3ea98..52e87ac 100644 (file)
@@ -175,7 +175,7 @@ void MoveItemToTrash(const base::FilePath& path) {
   SHFILEOPSTRUCT file_operation = {0};
   file_operation.wFunc = FO_DELETE;
   file_operation.pFrom = double_terminated_path;
-  file_operation.fFlags = FOF_ALLOWUNDO;
+  file_operation.fFlags = FOF_ALLOWUNDO | FOF_SILENT | FOF_NOCONFIRMATION;
   SHFileOperation(&file_operation);
 }