AutoHotkey Community

It is currently May 26th, 2012, 6:27 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: February 15th, 2009, 9:07 pm 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
It took me a while to figure this whole thing out, so I decided to share my findings!
This little example gives you a list of all the shared files currently open on the machine specified (see script for details) by using NetFileEnum.
You'll have to wrap it yourself if you want to use it in your own script.

Download

This script uses Titan's Anchor function (integrated in the script). Thanks!
Can someone with an OS < Windows 2000 please check if it works on your machine.


Last edited by TheGood on February 16th, 2009, 2:07 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2009, 2:06 am 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
OK, it is now possible to see the list of open shared files on another computer. Just make sure you have the credentials to execute it or you'll get ERROR_ACCESS_DENIED.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2009, 5:18 pm 
Offline
User avatar

Joined: September 8th, 2008, 12:26 am
Posts: 1048
Location: Ploieşti, RO
There is no NetFileEnum in netapi32.dll on Win98SE. :(
But it's present in SVRAPI.DLL and RADMIN32.DLL (also a NetFileEnumA).
NetApiBufferFree is only present in RADMIN32.DLL.

However, calling any of the two doesn't get any result displayed.

The call to NetFileEnum in RADMIN32.DLL returns r=2351 and everything else is zero (pFileInfo, iCount, iTotal). :(
Calling NetFileEnumA returns r=2106, everything else still zero.

ErrorLevel is zero in both cases.

_________________
AHK tools by Drugwash (AHK 1.0.48.05 and Win98SE)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2009, 6:36 pm 
Offline

Joined: July 30th, 2007, 11:32 pm
Posts: 581
Thanks for testing.
I found this sample code for Win95/98/Me showing how to use NetFileEnum. It seems like it takes one less argument and that the struct used (file_info_50) contains one less member.
When I have time, I'll install Win98 on a VM to test it out.
I'm in exam periods right now but I'll look into it in 2 or 3 weeks :D


Report this post
Top
 Profile  
Reply with quote  
PostPosted: October 13th, 2011, 5:13 pm 
Offline

Joined: October 13th, 2011, 5:07 pm
Posts: 1
hi,

I'm using NetFileEnum in my project.
but i'm not getting correct result.
My project is in c#.
if i want to get result for files that are open on my machine(i.e. machine on which visual studio running), what parameters i have to pass?

i tried so many things like passing null value in servername, basepath, username etc, but didn't worked for me.

please tell me detailed information what shall i do to get proper result for my local machine.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, Bing [Bot], Google Feedfetcher, Jaaaaaaaaay and 7 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group