Re: Disable files with dhtml/vbs?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: KM (konstmor_at_nospam_yahoo.com)
Date: 06/27/04


Date: Sun, 27 Jun 2004 00:08:12 -0700

Alexander,

Yes, it always sounds simple when you have done that :-)

A couple of hints for you (so that you don't spend much time on that).

Within the script use cmiThis object to refer to the instance in the context
of which you work.

When you enumerate your component (instance) resources, search for ones with
the property ResourceTypeVSGUID="{E66B49F6-4A35-4246-87E8-5C1A468315B5}".
Those will be the file resources.

A file name will be the value of the extended property "DstName" of the
resource (Properties collection).

So, the VB script that disables a particular file resource of the current
component instance may look like:
   For Each oResource In cmiThis.Resources
         If ("{E66B49F6-4A35-4246-87E8-5C1A468315B5}" =
oResource.ResourceTypeVSGUID) Then
              If oResource.Properties.Exists("DstName") And
oResource.Properties("DstName").Value="<you file name here>" Then
                    oResource.Properties.Disabled = True
                    Exit For
              End If
         End If
   Next

(I haven't tested the above you you will need to use/modify it on your own
risk).

For other resources (registry key, reg value, etc.) you will just need to
use different predefined GUIDs (not important for you now but for any future
use).

Regards,
    Konstantin

> So if it is that simple the only thing left is to find correct syntax.
Hack,
> you say? I like how it sounds :)
> Thank you.
>
>
> "KM" <konstmor@nospam_yahoo.com> wrote in message
> news:u%23Wou9wWEHA.1368@TK2MSFTNGP10.phx.gbl...
> > Alexander,
> >
> > Only resources I know is google (and my components on www.xpefiles.com
> :-)).
> > Basically, CMI is undocumented and will unlikely be documented for XPe.
> > If you want to deal with CMI (I agree - very handy stuff), you will have
> to
> > hack it.
> >
> > From what you wrote it is doable. You will have to work with Resources
> > collections of IInstance interface. You will just need to disable/enable
> > particular component (instance) resources like file entries you
mentioned.
> > Similar is implemented in the File filter search of the
DependencyExplorer
> > component from www.xpefiles.com.
> >
> > KM
> >
> > > Uh... I guess I'm asking too much. Well then.
> > >
> > > Is there *any* CMI reference available?..
> > >
> > > "Alexander Suhovey" <asuhovey@mtu-net.ru> wrote in message
> > > news:OVJU88qWEHA.2576@TK2MSFTNGP10.phx.gbl...
> > > > Hi,
> > > > Currently i'm trying to look into all this handy dhtml/vbs/cmi stuff
> to
> > > make
> > > > custom settings pages for my components. In particular, I have one
> > simple
> > > > component that sets pre-login wallpaper to my company's logo as well
> as
> > > > default background color. This component includes two bmps - one for
> > > > portrait screen alignment, one for landscape. I already have figured
> > (with
> > > > help of this NG of course) how to create a setting page wich allow
> > > developer
> > > > to choose correct wallpaper. Then script sets correct wallpaper in
> > > registry
> > > > according to dhtml settings tab. What I also want to achieve is that
> > only
> > > > one bmp is copied to image. So I guess I should change component
> script
> > so
> > > > it disables unneeded bmp in component properties so it will not be
> > copied
> > > to
> > > > image.
> > > > Somebody could say "Hey, you can simply create two components
instead
> of
> > > > one". Yeah I know, I'm trying to do this rather for educational
> > purposes.
> > > >
> > > > Can it be done this way? If yes, could somebody please provide some
> vbs
> > > > sample?
> > > >
> > > > Thanks in advance,
> > > > Al.
> > > >
> > > >
> > >
> > >
> > >
> >
> >
>
>
>
>



Relevant Pages

  • Expect: resource cleanup
    ... I have a problem on releasing expect resources. ... to complete I fall out of file resources ... Prev by Date: ...
    (comp.lang.tcl)
  • Are sysctl(8) values useful for measuring system resource consumption?
    ... the "developer experience," what resources are thus consumed, and figure ... script that essentailly acts as a bit of "scaffolding" around time; ... the script sets things up to invoke timewith the "-l" flag (so we ...
    (freebsd-performance)
  • Re: Configure failover in seconds
    ... You'll probably have to experiment to find the optimal settings since you don't want to ignore failed resources. ... When a failover starts, it starts. ... add this script as a resource to your cluster ... and your disk resources do not come online until your script finishes. ...
    (microsoft.public.windows.server.clustering)
  • Re: Trusted sites issue...
    ... Have you ensured that your script does not include references ... If the script uses resources ... from an unsecured area, or sends to a different site, it may be ... Internet Explorer Security Options, Part 1 ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Ruby 1.9.1, Threads and "The handle is invalid."
    ... will generate overhead and highly likely you're exhausting resources ... Actually I get the crash for both 700 threads and 10 threads. ... I wrote the script with 25 threads and the 700 one remained from the ...
    (comp.lang.ruby)