Jump to content
Sign in to follow this  
mozart90

How to detect a File is used by another User ?

Recommended Posts

Joon

You can pipe out the NET FILE and parse it.

Share this post


Link to post
Share on other sites
seandisanti

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
dabus

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
mikeytown2

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
dabus

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.