From: Leon on 6 Sep 2010 09:32 this drive letter is only - an example! we alle have c:\ some have d:\ and so on... :-) The issue here is how to get the result fra the WMI... if disk is noty psysical. On 3 Sep., 23:02, "Todd Vargo" <tlva...(a)sbcglobal.netz> wrote: > Kenneth A. Larsen wrote: > > "Tom Lavedas" <tglba...(a)verizon.net> wrote: > > snip... > > > > > > > > > set colFiles = objSWbemServices.ExecQuery _ > > ("Select * from CIM_Datafile Where Name = 'K:\ > > \myfile.txt'") > > > BTW, if I'm not mistaken, the drive K: must be accessible to the user > > you are using to log in to the machine. Otherwise, I would expect > > this query to fail, even when you correct the syntax. > > > Considering your statement that you're trying to catch some event, I > > suspect this still doesn't answer your really intent. Maybe you can > > explain what it is you want to accomplish, without regard to the way > > you are trying to do it, so that others might offer better advice. > > _____________________ > > Tom Lavedas > > > Is K:/ a drive, because I never heard of it? > > Yes. A: through Z: are valid drive letters. > > -- > Todd Vargo > > (Post questions to group only. Remove "z" to email personal messages)- Skjul tekst i anførselstegn - > > - Vis tekst i anførselstegn -
From: Ruediger Roesler on 6 Sep 2010 12:44
Leon <kim.zethsen(a)gmail.com> typed: > this drive letter is only - an example! > we alle have c:\ > some have d:\ > and so on... :-) > > The issue here is how to get the result fra the WMI... if disk is noty > psysical. I don't know anything about VB, but this is a code, I've written in VBS. Possibly it is useful for your demands: Sub Compress(strFile) With objSWbemServices.Get("CIM_Datafile='" & strFile & "'") ' don't use any spaces: ^^^^ If Not(.Compressed) Then .Compress End With End Sub Is that wizardry? Oh Yeeaah, it is! -- ЯR |