FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


need help from a VBS guru... how to cacls using VB





jdelfire
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
Related topics
751 Useful Windows XP Files
Use XHTML + CSS to get higher ranking!
Report Post mod
Visual Basic Coding with dll's
What to learn first?
Clan NDA HELP NEEDED FOR WEBSITE
Need vb.net or Flash ActionScript Help!
question on vb programming...
need help with a script for vb its not to hard i think
HELP, reading text file from USB drive in visual basic
need help from VBS guru.... how to delete a registry key?
Seek help on playing DMC4 using GMA950 video processing chip
Rgistry keys modification using VB Script
Using Etag as Session - Comments Needed Please
Reply to topic    Frihost Forum Index -> Computers -> Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.