473,397 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

SHFileOperation

I am using SHFileOperation() to copy files from the local hard drive a network share using a mapped drive. I want to set the up as a batch process with no user intervention. I have using the fFlags of FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_SILENT | FOF_NOERRORUI. When I added the FOF_NOERRORUI flag and a call to SHFileOperation() fails; all subsequent calls to the function fail with the same error code. Remove the FOF_NOERRORUI flag and SHFileOperation() operates normally; but i get a dialog box that requires a user response when an error occurs. shell32.dll in Windows XP is version 6.0.2800.1233. 1) How do I reset the SHFileOperation() after a failure with no user intervention? 2) How do I report the apparent "bug" to without having to pay fees?
Nov 17 '05 #1
1 3855
Are you copying each file individually in calls to SHFileOperation or are
you using a wildcard in the source? If you are copying 1 by 1 you can check
if an error is returned from the function (non-zero) or if
fAnyOperationsAborted is set to true. In that case you can log that the
specific file failed and move on to the next file.

What is the error dialog you are getting? What is the scenario that is
failing (source/destination path)?

Thanks,
Christopher Davis [MSFT]
"John Ericson" <an*******@discussions.microsoft.com> wrote in message
news:F1**********************************@microsof t.com...
I am using SHFileOperation() to copy files from the local hard drive a
network share using a mapped drive. I want to set the up as a batch
process with no user intervention. I have using the fFlags of
FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_SILENT | FOF_NOERRORUI. When
I added the FOF_NOERRORUI flag and a call to SHFileOperation() fails; all
subsequent calls to the function fail with the same error code. Remove the
FOF_NOERRORUI flag and SHFileOperation() operates normally; but i get a
dialog box that requires a user response when an error occurs. shell32.dll
in Windows XP is version 6.0.2800.1233. 1) How do I reset the
SHFileOperation() after a failure with no user intervention? 2) How do I
report the apparent "bug" to without having to pay fees?

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: mt | last post by:
How can i use the "SHFileOperation" with vb.net. i use the below code; but i get the error " Object reference not set to an instance of an object" please advise (and can i use this api for...
0
by: avishay | last post by:
Hi All, I want to use SHFileOperation using Python and Win32 extentions, in order to move a file to the trash can. The function itself can be accessed by importing win32com.shell.shell. However, I...
3
by: Lespaul36 | last post by:
I know that this is the API to use..is there a way to use it to delete an entire directory instead of just a file?
2
by: Lespaul36 | last post by:
Is there a way to use shfileoperation to delete an entire folder instead of just the files?
2
by: RichardF | last post by:
I have a simple function to copy a file. If I call this with the following paramerters... psFrom = C:\12345678901234567890.abc psTo = C:\12345678901234567890.xyz.abc The TO file ends up...
1
by: David S. | last post by:
Hi, I have a program that copy files using SHFileOperation, but my problem begins when i want copy files from another user. How can i do to copy files if i know the user and password? Thanks
0
by: =?Utf-8?B?TkVXMi5ORVQ=?= | last post by:
I have a .NET component (VC++) with native C++ at it's core. The native C++ code makes a call to SHFileOperation to delete a directory and it's contents. When I host the .NET component in a VB...
0
by: narsys | last post by:
I'm using SHFileOperation in my project. Everything is ok but something goes wrong when I want to use FOF_SIMPLEPROGRESS falg. when I set it it doesn't work. I can't see nothing! if I use ansi...
1
by: sambarker123 | last post by:
Hi all I am tring to copy a file.The code is as below int _tmain(int argc, _TCHAR* argv) { string s3,s4; s3="C:\\test\\to"; s4="C:\\test\\from\\sam.txt";
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.