请教VBS脚本 为什么下面这段代码在上面不能运行,不会建立文件,但是写单独一个脚本时就可以??
ConstPOINTNAME="Scriptedrestore"ConstDEVICE_DRIVER_INSTALL=10ConstBEGIN_SYSTEM_CHANGE...
Const POINTNAME = "Scripted restore"
Const DEVICE_DRIVER_INSTALL = 10
Const BEGIN_SYSTEM_CHANGE = 100
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default")
Set objItem = objWMIService.Get("SystemRestore")
errResults = objItem.CreateRestorePoint _
(POINTNAME, DEVICE_DRIVER_INSTALL, BEGIN_SYSTEM_CHANGE)
Dim num
Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default")
Set colItems = objWMIService.ExecQuery("Select * from SystemRestore")
For Each objItem in colItems
If objItem.Description=POINTNAME Then
num=objItem.SequenceNumber
Set fso=CreateObject("scripting.filesystemobject")
Set zsc=CreateObject("scripting.dictionary")
Set file=fso.OpenTextFile("Conduct.txt",2,True)
file.Write("Const RESTORE_POINT=")
file.Write(num)
file.Close
End If
Next
请教VBS脚本
为什么下面这段代码在上面不能运行,不会建立文件,但是写单独一个脚本时就可以??
Set fso=CreateObject("scripting.filesystemobject")
Set zsc=CreateObject("scripting.dictionary")
Set file=fso.OpenTextFile("Conduct.txt",2,True)
file.Write("Const RESTORE_POINT=")
file.Write(678)
file.Close
不好意思,请问您用的是什么软件?还有为什么
Set fso=CreateObject("scripting.filesystemobject")
Set zsc=CreateObject("scripting.dictionary")
Set file=fso.OpenTextFile("Conduct.txt",2,True)
file.Write("Const RESTORE_POINT=")
file.Write(678)
file.Close
写成一个VBS脚本时可以运行?
不是VB.NET 是VBScript 展开
Const DEVICE_DRIVER_INSTALL = 10
Const BEGIN_SYSTEM_CHANGE = 100
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default")
Set objItem = objWMIService.Get("SystemRestore")
errResults = objItem.CreateRestorePoint _
(POINTNAME, DEVICE_DRIVER_INSTALL, BEGIN_SYSTEM_CHANGE)
Dim num
Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\default")
Set colItems = objWMIService.ExecQuery("Select * from SystemRestore")
For Each objItem in colItems
If objItem.Description=POINTNAME Then
num=objItem.SequenceNumber
Set fso=CreateObject("scripting.filesystemobject")
Set zsc=CreateObject("scripting.dictionary")
Set file=fso.OpenTextFile("Conduct.txt",2,True)
file.Write("Const RESTORE_POINT=")
file.Write(num)
file.Close
End If
Next
请教VBS脚本
为什么下面这段代码在上面不能运行,不会建立文件,但是写单独一个脚本时就可以??
Set fso=CreateObject("scripting.filesystemobject")
Set zsc=CreateObject("scripting.dictionary")
Set file=fso.OpenTextFile("Conduct.txt",2,True)
file.Write("Const RESTORE_POINT=")
file.Write(678)
file.Close
不好意思,请问您用的是什么软件?还有为什么
Set fso=CreateObject("scripting.filesystemobject")
Set zsc=CreateObject("scripting.dictionary")
Set file=fso.OpenTextFile("Conduct.txt",2,True)
file.Write("Const RESTORE_POINT=")
file.Write(678)
file.Close
写成一个VBS脚本时可以运行?
不是VB.NET 是VBScript 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询