Jump to content
Sign in to follow this  
methodclass

fileexists() function for UNC paths

Recommended Posts

methodclass

Hello all,

As title suggests, is there a function similar to fileexists() that can test whether a UNC path exists and is valid.

Short and sweet,

james

Share this post


Link to post
Share on other sites
methodclass

Should work fine... did you try it ?

:)

sorry should have mentioned that

doesnt work with folder or printer shares, have tried dns name/ip address, no go..

Share this post


Link to post
Share on other sites
Jos

sorry should have mentioned that

doesnt work with folder or printer shares, have tried dns name/ip address, no go..

Printshares is something different but \\servername\sharename works fine.

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
jguinch

Hello,

You can use the net view command line, and store the result in a temporary file and read it with AutoIt

you can use a script like this :

$computer = "\\IPAddress"

RunWait(@comspec & ' /c net view ' & $computer & ' > ' & '"' & @TempDir & '\netview.txt"')

You have just to use the AutoIt files fonctions to read the result

Another way is to use DriveMapAdd without giving a device name :

Instead of using FileExist, try :

If DriveMapAdd("", "\\computer\share") ...

Share this post


Link to post
Share on other sites
methodclass

Hello,

You can use the net view command line, and store the result in a temporary file and read it with AutoIt

you can use a script like this :

$computer = "\\IPAddress"

RunWait(@comspec & ' /c net view ' & $computer & ' > ' & '"' & @TempDir & '\netview.txt"')

You have just to use the AutoIt files fonctions to read the result

Another way is to use DriveMapAdd without giving a device name :

Instead of using FileExist, try :

If DriveMapAdd("", "\\computer\share") ...

i was thinking id have to do something along the lines of this... thanks for the sample code...

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  

×