mozart90 Posted March 2, 2006 Posted March 2, 2006 Hi is there a possibility to detect whether a file is already in use by another user? geetings mozart90 Easy Zip Compression using XP
seandisanti Posted March 2, 2006 Posted March 2, 2006 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.
mozart90 Posted March 3, 2006 Author Posted March 3, 2006 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 Easy Zip Compression using XP
dabus Posted March 3, 2006 Posted March 3, 2006 Try this one 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 )
mikeytown2 Posted March 3, 2006 Posted March 3, 2006 (edited) Info on net filehttp://www.microsoft.com/resources/documen...s/net_file.mspxDid 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 March 3, 2006 by mikeytown2 Email: POP3 & SMTP using SSL/TLS (OpenSSL)Email: IMAPEmail: Base64 & SMTP login & Send email direct to MX Server (thanks blindwig)Win: Hook Registry ChangesWin: Read/Write to Alternate Data Streams (ini example)Utility: GPS Distance Calculations, Vincenty and Haversine formulas; angles and elevationUtility: Dell Laser Printer (3000-5100) - Print LoggerUtility: Reset Router when Wireless Link FailsUtility: ImageMagick Batch jpg ProcessorVideo HCenc Batch FrontendVideo: *DEAD* YouTube Video Encoder (avs/avi to flv)Software On CD's I Like<<back|track3 Ultimate Boot CD for Windows SpinRite Ubuntu ophcrack
dabus Posted March 3, 2006 Posted March 3, 2006 (edited) Arrg, include again. Stupid me... Edited March 3, 2006 by dabus
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now