VB脚本错误路径找不到路径(800A004C)
我需要创建 vbscript,它将创建新文件夹“test”和子文件夹“Output”。已经有一个文件夹结构 C:\Documents and Settings\All Users\Application Data\Fmwire,我需要在这些结构下创建 test\Output
我已经创建了这样的 vbscript,但我收到这样的错误
:错误:找不到路径 代码:800A004C 来源:Microsoft VBScript 运行时错误
Const OSCPATH = "\Fmwire\test\Output"
Const ALL_USERS_APPLICATION_DATA = &H23&
Dim fso ' File System Object
Dim objApplication ' Application object
Dim objFolder ' Folder object
Dim objFolderItem ' FolderItem object
Dim fname ' Path to Settings folder
Set objApplication = CreateObject("Shell.Application")
Set objFolder = objApplication.Namespace(ALL_USERS_APPLICATION_DATA)
Set objFolderItem = objFolder.Self
fname = objFolderItem.Path & OSCPATH
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FolderExists(fname) Then
Set objFolder = fso.GetFolder(fname)
Else
Set objFolder = fso.CreateFolder(fname)
If Err Then
Err.Clear
strErr = SPOFOLDERFAIL
rCode = 4
End If
End If
我必须做哪些更改才能纠正此错误
I need to create vbscript which will create new folder 'test' and subfolder 'Output'.There is already a folder structure C:\Documents and Settings\All Users\Application Data\Fmwire,I need to create test\Output under those structure
I have created vbscript like this but i am getting error like this
Error: Path not found
Code: 800A004C
Source: Microsoft VBScript runtime error
Const OSCPATH = "\Fmwire\test\Output"
Const ALL_USERS_APPLICATION_DATA = &H23&
Dim fso ' File System Object
Dim objApplication ' Application object
Dim objFolder ' Folder object
Dim objFolderItem ' FolderItem object
Dim fname ' Path to Settings folder
Set objApplication = CreateObject("Shell.Application")
Set objFolder = objApplication.Namespace(ALL_USERS_APPLICATION_DATA)
Set objFolderItem = objFolder.Self
fname = objFolderItem.Path & OSCPATH
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FolderExists(fname) Then
Set objFolder = fso.GetFolder(fname)
Else
Set objFolder = fso.CreateFolder(fname)
If Err Then
Err.Clear
strErr = SPOFOLDERFAIL
rCode = 4
End If
End If
What changes i have to do for correcting this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)