Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- strComputer = “.”
- Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)
- Set colFiles = objWMIService.ExecQuery _
- (“Select * From CIM_Datafile Where Name = ‘C:\\Scripts\\Test.txt'”)
- If colFiles.Count > 0 Then
- Wscript.Quit
- Else
- Wscript.Echo “The file does not exist.”
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement