Actually you can install WMI on Win 95, but the TakeOwnership method
might not work. Win 9x doesn't support the same number of methods and
properties as Windows NT/2000/XP.
Stein Borge
Managing Enterprise Systems with the Windows Script Host
Over 800 pages of practicle solutions oriented material, providing
detailed coverage of WSH 5.6, WMI,
ADSI, ADO, CDO, FSO and much more.
www.EnterpriseWSH.com
On Fri, 21 Dec 2001 10:58:40 +1030, "Damien Holben"
Quote:
>Thanks for the information!
>One little problem - and I should have mentioned this earlier (sorry).
>Some of the clients are running Win95 - that means I can't use WMI for them
>doesn't it?
>> You can use WMI to take ownership of files. In the following code
>> sample the ownership is changed for a specified file:
>> 'connect to WMI namespace on local machine
>> Set objServices=GetObject("winmgmts:{impersonationLevel=impersonate}")
>> 'get a reference to a file
>> Set objFile = objServices.Get("CIM_DataFile.Name='d:\data\report.doc")
>> If objFile.TakeOwnership = 0 Then
>> Wscript.Echo "File ownership successfully changed"
>> Else
>> Wscript.Echo "File ownership transfer operation"
>> Endif
>> You'll need WMI. Since you are moving to Windows 2000 this won't be a
>> problem since it's included with the OS, but if you need to do it on
>> NT4 boxes you will need to install WMI on each box.
>> Regards,
>> Stein Borge
>> Author of Managing Enterprise Systems with the Windows Script Host
>> Over 800 pages of practicle solutions oriented material, providing
>> detailed coverage of WSH 5.6, WMI,
>> ADSI, ADO, CDO, FSO and much more.
>> www.EnterpriseWSH.com
>> On Wed, 19 Dec 2001 16:56:15 +1030, "Damien Holben"
>> >We are swapping out some servers soon. Old ones are NT4, new ones are
>> >Windows 2000.
>> >We were looking at using the Quota Manager in windows 2000 to manage
>users
>> >home directories.
>> >Problem - Quota manager calculates space on ownership of files. When we
>> >transfer the data from the old server to the new one, the ownership of
>the
>> >files will change because an administrator will be doing the transfer.
>That
>> >sort of makes the quota idea go out the window.
>> >Is there a way I can use a login script so that it will go through each
>of
>> >the files the next time the user logs take ownership of them (ie. make
>the
>> >user the new owner)?
>> >Thanks in advance -
>> >Damien