Login | |
|
 |
RE: cacls to text file - 7/31/2006 12:43:06 AM
|
|
 |
|
| |
Country73
Posts: 735
Score: 10
Status: offline
|
If you already know how to send it through the command prompt, then it's not too much of a change to send it through vbscript. Set oShell = CreateObject("Wscript.Shell") oShell.Run "cmd /c cacls \\<ComputerName>\<Share>\<Folder> /G Administrators:F;F /E /Y",0,True This is setting up that specific folder, Administrator Full Control, Editing so that the other permissions are not discarded. No window is displayed and wait for completion before stepping throught the rest of your code. Completely messed this one up, please disregard, was using portion of an XCACLS script.
< Message edited by Country73 -- 7/31/2006 1:21:07 AM >
|
|
| |
|
|
|
 |
RE: cacls to text file - 7/31/2006 1:18:07 AM
|
|
 |
|
| |
Country73
Posts: 735
Score: 10
Status: offline
|
Sorry, jumped the gun a little bit on this. I re-read your post and realized you are wanting to import the information you would normally see in the command window into a text file. For that, all you would need to do is: Set oFS = CreateObject("Scripting.FileSystemObject") Set oShell = CreateObject("Wscript.Shell") Set x = oFS.OpenTextFile("Calc_Info.txt",8,True) Set oExec = oShell.Exec("cmd /c cacls \\<computername>\<share>\<folder>") Do Until oExec.StdOut.AtEndOfStream myLine = oExec.StdOut.ReadLine x.WriteLine myLine Loop x.Close MsgBox "Finished running Calcs",0,"Calc_Info"
|
|
| |
|
|
|
|
|