Mr. Bednarek is suggesting a $100 program to do Windows
admin. tasks. If that's necessary then I guess it's time
to move to Linux. :)
Also, I don't know whether icacls recognizes special
folder paths. If you need to find those paths on other
machines you can use Shell.Application. The method is
slightly convoluted, but it works. It's a wrapper for the
various Windows API methods to get special folders.
Shell.Application is basically the object model for Explorer
and its folder view.
Mr. Wieser had a typo in his post, saying that objFSO.run
can be used to run icacls. That should have been:
Set WS = CreateObject("WScript.Shell")
SH.Run
The Run method can run a command line and optionally
wait for the call to return. I haven't used icacls, but I
assume Run will work for that. Don't you also need to set
permissions after the setowner call?
WMI also has methods for setting ownership and
permissions. But be warned, both permisisons and
WMI are a convoluted mess. For WMI you need to
get a Win32_SecurityDescriptor via the GetSecurityDescriptor
method of Win32_LogicalFileSecuritySetting.
Personally I don't have any experience with network
admin, but my understanding is that WMI is designed
especially for that, so you probably want to familiarze yourself
with it. It's a pain to use but if you search for
something like: WMI Win32_SecurityDescriptor owner
you should find some VBScript samples. (I have sample
in a WMI book but it's too much to transcribe.)
If you don't have the WMI help file you should probably
get a copy. Unfortunately, virtually all Windows
docs now come only in the gigantic Windows SDK. In addition
to downloading that, the help files now come as HXS "help 2"
files, with no standalone viewer. If you want to get CHMs
of these files you can download the SDK, unpack it, and convert
the HXS files to CHM. See here for tools and directions:
http://www.jsware.net/jsware/hxs2chm.php5
The download is a set of scripts and an HTA that I wrote
myself when I discovered that Microsoft had withdrawn
virtually all of the smaller SDKs and doc packages in favor
of a single, large SDK intended to integrate with Visual
Studio.Net. Since most of the docs now are .Net or the
newer WinRT API (for writing TileUI trinkets) there's no
reason for Windows programmers and scripters who are
not using .Net, to install what amounts to multiple GBs of
bloat, just to read a 1 MB help file. If you download and
unpack any recent vintage Windows SDK you can also get
the IE DOM help, SAPI, Shell, WSH, etc. and convert those
to CHMs for future reference.
--
--
<
kerkuk...@gmail.com> wrote in message
news:71d87fd2-0d77-4496...@googlegroups.com...