Hi everyone
I use cacls on removing virus on a computer by disabling or granting no access on the virus.
I don't know much in VB. I'm thinking of using the cacls command in VB but what I want is to cacls more than one file or folder. is there a way for me to create like a dialog box where I can copy and paste the directory of file or folder that I want to cacls? Thank you all in advance. ^_^
Option Explicit
Dim objWMIService, objProcess, objCalc
Dim strShell, objProgram, strComputer, strExe
strComputer = "."
strExe = "C:\WINDOWS\System32\cacls.exe" & " " & Chr(34) & "C:\Program Files\Windows Media Player\wmplayer.exe" & Chr(34) & " /E /P USERS:n"
' Connect to WMI
set objWMIService = getobject("winmgmts://"_
& strComputer & "/root/cimv2")
' Obtain the Win32_Process class of object.
Set objProcess = objWMIService.Get("Win32_Process")
Set objProgram = objProcess.Methods_( _
"Create").InParameters.SpawnInstance_
objProgram.CommandLine = strExe
'Execute the program now at the command line.
Set strShell = objWMIService.ExecMethod( _
"Win32_Process", "Create", objProgram)
WScript.echo "Created: " & strExe & " on " & strComputer
WSCript.Quit
I use cacls on removing virus on a computer by disabling or granting no access on the virus.
I don't know much in VB. I'm thinking of using the cacls command in VB but what I want is to cacls more than one file or folder. is there a way for me to create like a dialog box where I can copy and paste the directory of file or folder that I want to cacls? Thank you all in advance. ^_^
Option Explicit
Dim objWMIService, objProcess, objCalc
Dim strShell, objProgram, strComputer, strExe
strComputer = "."
strExe = "C:\WINDOWS\System32\cacls.exe" & " " & Chr(34) & "C:\Program Files\Windows Media Player\wmplayer.exe" & Chr(34) & " /E /P USERS:n"
' Connect to WMI
set objWMIService = getobject("winmgmts://"_
& strComputer & "/root/cimv2")
' Obtain the Win32_Process class of object.
Set objProcess = objWMIService.Get("Win32_Process")
Set objProgram = objProcess.Methods_( _
"Create").InParameters.SpawnInstance_
objProgram.CommandLine = strExe
'Execute the program now at the command line.
Set strShell = objWMIService.ExecMethod( _
"Win32_Process", "Create", objProgram)
WScript.echo "Created: " & strExe & " on " & strComputer
WSCript.Quit
