Guest User

Untitled

a guest
Dec 6th, 2019
105
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. strComputer = “.”
  2. Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)
  3.  
  4. Set colFiles = objWMIService.ExecQuery _
  5. (“Select * From CIM_Datafile Where Name = ‘C:\\Scripts\\Test.txt'”)
  6.  
  7. If colFiles.Count > 0 Then
  8. Wscript.Quit
  9. Else
  10. Wscript.Echo “The file does not exist.”
RAW Paste Data