Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  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.”
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement