The Set of fso=CreateObject (" Scripting. FileSystemObject ")
The Set f=fso. OpenTextFile (" C: \ Windows \ System32 \ drivers \ etc \ hosts ", ForReading)
ReadAllTextFile=f.R eadAll
CodePudding user response:
Is usually a permissions problem, want to run the VBS as an administrator,CodePudding user response:
Closed the 360?CodePudding user response:
I manually tested underNo problem
Can open, the estimate is permissions or firewall problems
Const ForReading=1
The Set objFSO=CreateObject (" Scripting. FileSystemObject ")
The Set objFile=objFSO. OpenTextFile (" C: \ Windows \ System32 \ drivers \ etc \ hosts ", ForReading)
StrContents=objFile. ReadAll
MSGBOX strContents
ObjFile. Close