Sign in to follow this  
Followers 0
mozart90

How to detect a File is used by another User ?

7 posts in this topic

Hi

is there a possibility to detect whether a file is already in use by another user?

geetings mozart90

Share this post


Link to post
Share on other sites



You can pipe out the NET FILE and parse it.

Share this post


Link to post
Share on other sites

You can pipe out the NET FILE and parse it.

if it's a file that is locked when in use by another user, then it should generate an @error if you try to FileOpen() it.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

You can pipe out the NET FILE and parse it.

Sorry I don't understand. What Net File do you mean?

Can you explain please?

Greetings Mozart90

Share this post


Link to post
Share on other sites

Try this one :o

Dim $Result, $output=''
$Result=Run(@ComSpec &' /c net file', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
While 1
    $line = StdoutRead($Result)
    If @error = -1 Then ExitLoop
    $output = $output & @CR & $line
Wend
While 1
    $line = StderrRead($Result)
    If @error = -1 Then ExitLoop
    $output = $output & @CR & $line
Wend
MsgBox (0, 'Net file' , $ouput )

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Info on net file

http://www.microsoft.com/resources/documen...s/net_file.mspx

Did some debuging on the code above use this

#include <Constants.au3>
Local $Result, $output=''
$Result=Run(@ComSpec &' /c net file', "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
While 1
    $line = StdoutRead($Result)
    If @error = -1 Then ExitLoop
    $output = $output & @CR & $line
Wend
While 1
    $line = StderrRead($Result)
    If @error = -1 Then ExitLoop
    $output = $output & @CR & $line
Wend
MsgBox (0, 'Net file' , $output )
Edited by mikeytown2

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Arrg, include again.

Stupid me... :o

Edited by dabus

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0