473,394 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ManagementObject

S.D
Hi, i am trying to find the user who locks the file (ms excel or word file )
in a shared folder. I have written the code but
wmiObject.GetRelated("Win32_Process") returns no process.

How can i find the user?

Thanks for your assistance

Dim mySelect As New SelectQuery("select * from cim_datafile Where name='" &
fileName & "'")
Dim myResults As New ManagementObjectSearcher(mySelect)
For Each wmiObject As ManagementObject In myResults.Get()
For Each myProcess As ManagementBaseObject In
wmiObject.GetRelated("Win32_Process")
myProcess.Dispose()
Next
Next

Jul 21 '05 #1
1 2242
SD,

I have seen this question a lot of times before and never saw an answer.
However you say about an office file.

Maybe you can try it crossposted in one of these newsgroups.

microsoft.public.excel.programmers
microsoft.public.office.vba

I thougth that I had readed that Office had an extra mechanism.

I hope this helps?

Cor
Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Brian Piscopo | last post by:
Memory leak and .NET -- like oil and water :- I've written a distributed system for parallel processing of large tasks. Each machine has an agent on it that sends processor usage information back...
5
by: David Clegg | last post by:
I initially posted this to .Framework.WMI a week ago but am yet to have a response... I am having trouble changing properties of a Windows Service application using the ManagementObject class...
9
by: scsharma | last post by:
hi, I am trying following code. string fileObject = @"C:\Documents and Settings\myfolder\Temp.txt"; ManagementBaseObject ret = null; ManagementPath path = new ManagementPath( ); path.Server =...
0
by: Scupper | last post by:
I am using the System.Management namespace for the first time and I cannot get the ManagementObject.SetPropertyValue method to work properly. I am trying to change the ServerName and ShareName...
1
by: S.D | last post by:
Hi, i am trying to find the user who locks the file (ms excel or word file ) in a shared folder. I have written the code but wmiObject.GetRelated("Win32_Process") returns no process. How can i...
3
by: Joao Rego | last post by:
Hello, Im using WMI to get CPU information through Win32_Processor. It returns a collection but some items are "not valid". ..... foreach( ManagementObject oReturn in oReturnCollection ) {...
0
by: wasishincar | last post by:
Hi All, I am working on deleting disconnected devices in Device Manager. I write codes as below but get exception that tells something like "Provider Cannot do attempted operation" ErrorCode is...
2
by: DBC User | last post by:
Hi all, I am in a situation where I need to find the a unc path of a particular drive or I have a unc path, I need to find the drive. Either way will work. I do not want to use dllimport to make...
2
by: thiagoalencar22 | last post by:
Hello, Where can I find informations on which WMI queries are in fact available for .NET interface through ManagementObjectSearcher. The command below returns exception for "Win32_LogicalDisk",...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.