如何在使用Windows Explorer com模型复制文件时自动化“重试”? 我使用Windows Explorer com自动化特定的副本操作(无法通过常规文件系统副本完成): 导入pythoncom 来自win32comext.shell进口外壳 fo = pythoncom.cocreateinstance(

问题描述 投票:0回答:1
一旦每千文件,我就会得到:

Error0x802a0006

UI_E_VALUE_NOT_DETERMIND 0x802A0006 无法确定请求的值。

对话框上的“重试”并检查复选框“为将来文件执行此操作”对将来的文件无济于事,因此自动化时是一个问题。
问题:

1。使用
shell.FOF_NOCONFIRMATION

使对话框选择自动选择“重试”或“忽略”或“取消”?哪一个是正确的?

2。有没有办法可以在没有对话的情况下重试的自动化?不用手动进行

for _ in range(MAX_RETRIES): try: ... except: ...

	
为了使您的自动化平稳,您可以抑制Guı

fo.SetOperationFlags( shellcon.FOF_NOCONFIRMATION | # Suppress confirmation dialogs shellcon.FOF_SILENT | # Suppress UI shellcon.FOF_NOERRORUI | # Suppress error dialogs shellcon.FOF_NOCONFIRMMKDIR # Create directories automatically ) enter image description here这将帮助您在没有GUI的交流的情况下移动 发生错误时

try: # do copying except pythoncom.com_error as e: # when error happens
python windows com pywin32 file-copying
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.