- 帖子
- 12
- 积分
- 31
- 技术
- 1
- 捐助
- 0
- 注册时间
- 2018-9-19
|
回复 zhenzhu
我测试没问题。可以发一下A01里面的文件的全路径看一下
pd1 发表于 2023-11-22 16:56
我后面测试又发现点小问题,如果父文件夹的名称有特殊字符,就无法处理了
中文 对照_3(2016) √
中文 对照-2(2019) √
中文 对照1(2019)[x5-x6] ×
应该是因为中括号的问题
------------------------------
md : 具有指定名称 C:\Users\Administrator\Desktop\test - 副本\中文 对照1(2019)[x5-x6]\ 的项已存在。
所在位置 行:6 字符: 116
+ ... ce "\\\d+(?=\\)","";if(-not (Test-Path $newpath)){md $newpath};Move-I ...
+ ~~~~~~~~~~~
+ CategoryInfo : ResourceExists: (C:\Users\Admini...1(2019)[x5-x6]\:String) [New-Item], IOException
+ FullyQualifiedErrorId : DirectoryExist,Microsoft.PowerShell.Commands.NewItemCommand
md : 具有指定名称 C:\Users\Administrator\Desktop\test - 副本\中文 对照1(2019)[x5-x6]\ 的项已存在。
所在位置 行:6 字符: 116
+ ... ce "\\\d+(?=\\)","";if(-not (Test-Path $newpath)){md $newpath};Move-I ...
+ ~~~~~~~~~~~
+ CategoryInfo : ResourceExists: (C:\Users\Admini...1(2019)[x5-x6]\:String) [New-Item], IOException
+ FullyQualifiedErrorId : DirectoryExist,Microsoft.PowerShell.Commands.NewItemCommand
md : 具有指定名称 C:\Users\Administrator\Desktop\test - 副本\中文 对照1(2019)[x5-x6]\ 的项已存在。
所在位置 行:6 字符: 116
+ ... ce "\\\d+(?=\\)","";if(-not (Test-Path $newpath)){md $newpath};Move-I ...
+ ~~~~~~~~~~~
+ CategoryInfo : ResourceExists: (C:\Users\Admini...1(2019)[x5-x6]\:String) [New-Item], IOException
+ FullyQualifiedErrorId : DirectoryExist,Microsoft.PowerShell.Commands.NewItemCommand |
|