Questions tagged [shfileoperation]

Use this tag for question about SHFileOperation function

35 questions
1
vote
1 answer

python win32com shell.SHFileOperation - any way to get the files that were actually deleted?

In the code I maintain I run across: from win32com.shell import shell, shellcon # ... result,nAborted,mapping = shell.SHFileOperation( (parent,operation,source,target,flags,None,None)) In Python27\Lib\site-packages\win32comext\shell\ (note…
Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
1
vote
1 answer

SHFileOperation makes directory "undeletable"

Okay, so I have an application that creates a sub-directory inside the %TEMP% directory to keep some intermediate files, while the application is still running. And, when the application is about to exit, I will call a clean-up function in order to…
MuldeR
  • 577
  • 1
  • 4
  • 17
1
vote
1 answer

Win 32 API: SHFileOperation merge folders

I have 2 folders: m:\folder1 and m:\folder2 I would like to merge folder2 with folder1 so that only folder1 exists. I tried using SHFileOperation With SHFileOp .wFunc = FO_FUNC .pFrom = "m:\folder2" .pTo = "m:\folder1" .fFlags =…
tmighty
  • 10,734
  • 21
  • 104
  • 218
1
vote
1 answer

SHFileOperation replace file dialog

Currently, SHFileOperation has some confirm file replacement dialog boxes that ask the user if they would like to replace a file or not. I find these useful, but I would like to be able to modify the scenario in which they occur. Instead, I would…
JHowzer
  • 3,684
  • 4
  • 30
  • 36
1
vote
3 answers

How to write a Linux Driver, that only forwards file operations?

I need to implement a Linux Kernel Driver, that (in the first step) only forwards all file operations to another file (in later steps, this should be managed and manipulated, but I don't want to discuss this here). My idea is the following, but when…
nico
  • 1,039
  • 4
  • 13
  • 27
0
votes
2 answers

Why does SHFileOperationW create folder instead of move file?

I have created own "Move" function based on SHFileOperationW like this: int MoveItem(string strSourcePath, string strDestinationDirectory, string strNewName, bool bAllowOverwrite, bool bCreateDestinationDirectoryIfNotExist) { int…
0
votes
1 answer

Exception in Concurrency task.then.wait affects further call of ::ShellExecuteEx()

Following logic is implemented to open a file by a "filename.extension" in a C++ application using managed-C++: try { CoInitialize(nullptr); auto task =…
Viktor Be
  • 658
  • 1
  • 11
  • 25
0
votes
0 answers

How to copy specific subfolder from directory usin poweshell

Path1: D:\TestFolder\1001\TestSubFolder1\TestSubFolder2\ Path2: D:\TestFolder How to copy TestSubFolder2(with inside contents) of the path1 to path2? Note: In path1 the folder 1001 is a dynamic name, it always gets change so can not use full…
0
votes
0 answers

IFileOperation: How can you tell if a rename of a folder merged with another?

When you use IFileOperation to rename a directory that matches the name of another directory it offers to merge. If you choose yes, it merges but no indication of the fact that it merged with another one. Is there an easy way to tell? You can…
user3161924
  • 1,849
  • 18
  • 33
0
votes
1 answer

Error using SHFileOperation() to copy a folder

I am trying to use SHFileOperation() to copy a folder, but get this error: a value of type "const char *" cannot be assigned to an entity of type "PCZZWSTR" for both s.pTo and s.pFrom. The code I'm using is: SHFILEOPSTRUCT s = { 0 }; s.hwnd =…
SA1234
  • 3
  • 2
0
votes
0 answers

Is that safe to delete connected files with Python os.remove on Windows

On Windows, creating file filename.htm sometimes create an associated folder filename.files at the same time if needed. If we delete filename.htm, the associated folder is deleted at the same time. According to this, it is a behavior of Windows…
minion
  • 561
  • 4
  • 17
0
votes
1 answer

Performance issue when moving of files on network shares

I'm writing an application which can copy files on a network share. Usually the files are moved on the same physical hard drive. If you test this with Windows Explorer, this operation will be executed really quickly. It seems, that Windows knows…
Christian Metzler
  • 2,971
  • 5
  • 24
  • 30
0
votes
1 answer

get file name from IShellItem in IfileOperation.GetDisplayName

I hooked the CopyItems method of IFileOperation to monitor/intercept file copy in windows. My problem is how can i retrieve the full file name from IShellItem(last param of CopyItems) function New_CopyItems(p: Pointer; punkItems:…
Kamran
  • 387
  • 1
  • 3
  • 19
0
votes
1 answer

ShFileOperation in Delphi XE5

i'm having touble using SHFileOperation do Copy and delete *.mb and *.db files the CopyFiles code works great, copy all files and create the folder if needed but when i call DeleteFiles code something strange happens, all files in 'bkp' folder are…
Rebelss
  • 364
  • 1
  • 5
  • 15
0
votes
1 answer

SHFILEOPERATION with ShowMessage - C++ Builder

i write this code in C++ Builder to copy some folders from a network folder mounted on x: (eg x:\games\foldername) to a local path: d:\program files. I use shfileopstruct as follow. The source path (s variable) is taken from database using…
apo
  • 69
  • 2
  • 9