运行时错误800A01A8

时间:2011-09-05 12:44:58

标签: vbscript runtime-error

我现在非常困难!有人可以帮忙吗?!这是我不断得到的信息:

Windows脚本宿主 脚本:C:\ Documents and Settings \ Me \ Application Data \ bits2 \ windows.vbs 行:9 Char:1 错误:需要对象:'intOptionsSet' 代码:800A01A8 来源:Microsoft VBScript运行时错误

这是我的剧本:

Set WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2"
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder)
intOptions = 256
objTarget.CopyHere objSource, intOptions

2 个答案:

答案 0 :(得分:0)

看起来很糟糕......这个;

objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell")

可能应该是:

objTarget.CopyHere objSource, intOptions
Set WshShell = CreateObject("Wscript.Shell")

你可能只需要后一行,而不是你所拥有的所有重复。

编辑; 这也似乎只是重复了第9行?

答案 1 :(得分:0)

objShell.NameSpace()不喜欢彼此相邻的2个反斜杠,即c:\\

(除非它是网络路径,即\\ 192.168.0.1 \ Folder)

代码的前9行:

Set WshShell = CreateObject("Wscript.Shell")
appdata= WshShell.ExpandEnvironmentStrings("%appdata%")
strZipFile = appdata & "\bits2\file.zip"
outFolder = appdata & "\bits2" 'Line #4
Set objShell = CreateObject("Shell.Application")
Set objSource = objShell.NameSpace(strZipFile).Items()
Set objTarget = objShell.NameSpace(outFolder) 'Line #7
intOptions = 256
objTarget.CopyHere objSource, intOptionsSet. WshShell = CreateObject("Wscript.Shell") 'Line #9

也许第9行正在爆发,因为第7行的outFolder中有“:\\”。 outFolder在第4行定义。