473,387 Members | 1,859 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,387 software developers and data experts.

Want to access the UserCount for the File - VBScript

308 256MB
Hi All,

I am interested in knowing Users Count who all are Currently accessing the File File1.txt. I wrote a Vb Script to get the user Count. I am running the script on XP professional Edition.After some investigation I found the value of the oFile.InUseCount on XP coming to be null everytime.

Is there any other WMI class from which I'll get the list of Files in use by SYSTEM/User ?

Here is the VBScript -

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2.  
  3. Dim oWMI, oFile, strFilePath
  4. strFilePath = "C:\Program Files\Internet Explorer\iexplore.exe"
  5.  
  6. Set oWMI = GetObject("winmgmts:\\.\root\cimv2")
  7. Set oFile = oWMI.Get("CIM_DataFile.Name='" & strFilePath & "'")
  8.  
  9. WScript.Echo "CIM_DataFile.Name='" & strFilePath & "'"
  10.  
  11. REM : In Xp it seemed to be NULL most of the time
  12.  
  13. WScript.Echo oFile.InUseCount  --> returning NULL Every Time.
Please Let Me know If you have any solution over this.

Thanks!
Dec 23 '09 #1
0 1090

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Bobby Howell | last post by:
Hi. I have the following which I use either on my server using cscript (.vbs file) or identical code in my ASP pages. The problem is when running in ASP I recieve the following error:...
1
by: Peter Petrillo | last post by:
The Access development group here at this company has exported its reports in xml format from Access 2003. I have no influence on how they have created them. I received the following files xm...
5
by: Zalek Bloom | last post by:
Hello, I am developing a simple ASP application with VBScript and Access database. I am testing it on my Win98SE machine using Personal Web Server. My machine is Celeron 2000 with 512Mb RAM. On...
1
by: Stefanie Gardner | last post by:
I am a programmer, new to ASP.NET. I am modifying a clients existing web site that has been written strictly in .net. I have created a database in Access and have created an .asp file that...
4
by: korund | last post by:
Is there any difference to read & write to windows Registry with VBScript or JavaScript? Both scripting languages have similar syntax. What is preferable use for this? thanks.
7
by: Visitor No 3 | last post by:
My local Crinkles group(U3A), of which I am one, want me to develop a noddy database and web site for their members. Some are computer literate, others not so. I thought an Access 2000 .mdb on a...
2
by: Kosmos | last post by:
I am opening the following connections as such although I am only referring to the first connection for this question: Dim con1 As ADODB.Connection Dim con2 As ADODB.Connection Dim recSet1 As...
7
ADezii
by: ADezii | last post by:
There are essentially three techniques for publishing Access Data on the Web. The first technique is static, and does not allow for the dynamic addition or modification to the data, There is no...
8
by: Daveo | last post by:
Dear all, We recently migrated a SQL database from one server to another. Now, when you try to run some code in an Access Database which links to the SQL one, you get a 3704 error "Operation is...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.