Jump to content

How to detect a File is used by another User ?


Recommended Posts

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 )
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...