2011-09-05 76 views
1

我現在非常困難!有人可以幫忙嗎?!這是我不斷收到消息:運行時錯誤800A01A8

Windows腳本宿主 腳本:C:\ Documents和Settings \我\應用數據\ BITS2 \ windows.vbs 行:9 字符: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 
+1

你有沒有仔細看第9行objTarget.CopyHere?看起來可能有一部分代碼與另一行代碼結合在一起。 – BlueMonkMN

+2

答案可能就是這樣。但是我對這個代碼感到困惑。爲什麼你有相同的代碼重複22次? – BlueMonkMN

回答

0

那羅oks被打碎了......這個;

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

大概是應該是:

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

你可能只需要後者線一次,而不是你有重複。

編輯;這也似乎只是重複的拳頭9線?

0

objShell.NameSpace()不喜歡彼此相鄰,即,C 2個反斜槓:\\

(除非它是一個網絡路徑,即,\\ 192.168.0.1 \文件夾)

第一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吹了,因爲outFolder上線#7有:在它 「\\」。在#4行定義了outFolder