windows10 使用powershell "Add-PrinterPort"命令错误码 HRESULT 0x80070001

%3CLINGO-SUB%20id%3D%22lingo-sub-1961144%22%20slang%3D%22zh-CN%22%3EWindows10%20uses%20the%20powershell%20%22Add-PrinterPort%22%20command%20error%20code%20HRESULT%200x80070001%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1961144%22%20slang%3D%22zh-CN%22%3E%3CP%3ECopy%20on%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fanswers.microsoft.com%2Fzh-hans%2Fwindows%2Fforum%2Fwindows_10-hardware%2Fwindows10-%25e4%25bd%25bf%25e7%2594%25a8powershell-add%2Fe42168bb-ba19-40a7-aaa0-b813f22b186a%3Ftm%3D1607305819726%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fanswers.microsoft.com%2Fzh-hans%2Fwindows%2Fforum%2Fwindows_10-hardware%2Fwindows10-%25e4%25bd%25bf%25e7%2594%25a8powershell-add%2Fe42168bb-ba19-40a7-aaa0-b813f22b186a%3Ftm%3D1607305819726%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUse%20windows10%20administrator%20privilege%20powershell%20to%20add%20printer%20ports%20with%20the%20error%20code%20HRESULT%200x80070001%2C%3C%2FP%3E%3CP%3EFrom%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fopenspecs%2Fwindows_protocols%2Fms-erref%2F0642cb2f-2075-4469-918c-4441e69c548a%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fopenspecs%2Fwindows_protocols%2Fms-erref%2F0642cb2f-2075-4469-918c-4441e69c548a%3C%2FA%3E%20can't%20get%20valid%20content%20for%20the%20error%20code%20(the%20lowest%20code%20is%20not%20documented%20to%20say%20what%20it%20means)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20powershell%20command%20executed%3C%2FP%3E%3CP%3EAdd-PrinterPort%20-Name%20%22R%3A'tmp.txt'%3C%2FP%3E%3CP%3E%3CSPAN%3EWhere%20the%20R%20disk%20is%20a%20memory%20map%20disk%2C%20the%20software%20used%20is%20ImDisk%20(download%3CA%20href%3D%22https%3A%2F%2Fsourceforge.net%2Fprojects%2Fimdisk-toolkit%2F%EF%BC%89%E3%80%82%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Eaddress%3A%20https%3A%2F%2Fsourceforge.net%2Fprojects%2Fimdisk-toolkit%2F).%20%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20text%20copy%20of%20the%20error%20message%20is%20as%20follows%3A%3C%2FP%3E%3CP%3EAdd-PrinterPort%3A%20There%20was%20an%20error%20performing%20the%20specified%20operation.%20For%20more%20information%2C%20see%20the%20detailed%20error%20message.%3C%2FP%3E%3CP%3ELocation%20Line%3A%201%20Character%3A%201%3C%2FP%3E%3CP%3EAdd-PrinterPort%20-Name%20%22R%3A'tmp.txt'%3C%2FP%3E%3CP%3ECategoryInfo%20%3A%20NotSpecified%3A%20(MSFT_PrinterPortTasks%3A%20ROOT%2FStandardCimv2%2FMSFT_PrinterPortTasks)%20(Add-Prin%3C%2FP%3E%3CP%3EterPort%2C%20CimException%3C%2FP%3E%3CP%3EFullQualifiedErrorId%20%3A%20HRESULT%200x80070001%2C%20Add-PrinterPort%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%3EAsk%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E1.%20Error%20message%20HRESULT%200x80070001%20specific%20meaning%2C%20(code%20field%20has%20no%20clear%20documentation)%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E2.%20Try%20the%20next%20only%20in%20the%20memory%20map%20disk%20will%20return%20the%20mentioned%20error%2C%20normal%20hard%20disk%20files%20can%20be%20successful.%20But%20the%20requirement%20is%20to%20add%20a%20printer%20port%20to%20the%20memory%20map%20drive%2C%20can%20it%20be%20implemented%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3E3.%20If%20this%20is%20not%20possible%2C%20what%20is%20the%20difference%20between%20memory%20mapping%20files%20and%20ordinary%20hard%20drive%20files%3F%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22%22%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1966213%22%20slang%3D%22en-US%22%3ERe%3A%20windows10%20%E4%BD%BF%E7%94%A8powershell%20%22Add-PrinterPort%22%E5%91%BD%E4%BB%A4%E9%94%99%E8%AF%AF%E7%A0%81%20HRESULT%200x80070001%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1966213%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F892891%22%20target%3D%22_blank%22%3E%40zuisee%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3Eplease%20submit%20a%20feedback%20about%20the%20error%20you%20are%20experiencing%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fsupport.microsoft.com%2Fen-us%2Fwindows%2Fsend-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Efeedback%20hub%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ebtw%2C%20for%20anyone%20clicking%20on%20that%20link%20above%2C%20the%20correct%20link%20to%26nbsp%3BImDisk%20Toolkit%20is%20this%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fsourceforge.net%2Fprojects%2Fimdisk-toolkit%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fsourceforge.net%2Fprojects%2Fimdisk-toolkit%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

复制于

https://answers.microsoft.com/zh-hans/windows/forum/windows_10-hardware/windows10-%e4%bd%bf%e7%94%a8...

 

使用windows10 管理员权限 powershell添加打印机端口时提示错误码HRESULT 0x80070001,

从https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a无法得到错误码的有效内容(最低位的code=1没有文档指出是什么意思)

 

执行的powershell命令

Add-PrinterPort -Name "R:\tmp.txt"

其中R盘是一个内存映射盘,使用的软件是ImDisk(下载地址:https://sourceforge.net/projects/imdisk-toolkit/)。

 

错误信息文本复制如下:

Add-PrinterPort : 执行指定操作时出错。有关详情,请参阅详细错误信息。

所在位置 行:1 字符: 1

Add-PrinterPort -Name "R:\tmp.txt"

CategoryInfo          : NotSpecified: (MSFT_PrinterPortTasks:ROOT/StandardCimv2/MSFT_PrinterPortTasks) [Add-Prin

terPort], CimException

FullyQualifiedErrorId : HRESULT 0x80070001,Add-PrinterPort

 

 

问:

1.错误信息HRESULT 0x80070001的具体含义,(code字段有无明确文档说明)

2.试了下只有在内存映射盘里会返回提到的错误,正常的硬盘文件可以成功。但是需求是在内存映射盘里添加一个打印机的端口,可以实现吗?

3.如果不能实现,内存映射文件和普通硬盘文件有何不同

 

1 Reply

@zuisee 

Hi,

please submit a feedback about the error you are experiencing in the feedback hub

 

btw, for anyone clicking on that link above, the correct link to ImDisk Toolkit is this: https://sourceforge.net/projects/imdisk-toolkit/