473,384 Members | 1,854 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,384 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 2240
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.