FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a 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

need help from VBS guru.... how to delete a registry key?
Need help with subdomains of my hosting account!
Need Help, how to transfer to files to server using $_GET
google ad placement problems, need help
Need help wi th IPN's ....

accounts........yes i desperately need help.......^^
Need help fixing my php file
i need help with pause code in visual basic 6
Need help with Wordpress!
Flash Presentation Help

wordpress problem :( need help.. :(
Need help with database, can anyone help?
Navigation Script (javascript) Help Please!
Need help in Borland C++ 3.0
Need help with iTunes..

Need help understanding MySQL "Resource" type retu
Reply to topic    Frihost Forum Index -> Computers -> Software

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