Snippets ( Network )

From AutoIt Wiki
Revision as of 20:16, 15 November 2012 by Jaberwocky6669 (talk | contribs) (Edited snippets to conform to template Snippet Header.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Alert2.gif Please always credit an author in your script if you use their code. It is only polite.


_IsNetworkShare

Author: guinness







Check if a path is a network drive.


; Check if a path is a network drive.

ConsoleWrite( _IsNetworkShare(@ScriptDir) & @CRLF)

Func _IsNetworkShare($sFilePath)
    Return (Not StringMid($sFilePath, 2, 1) = ":")
EndFunc   ;==>_IsNetworkShare

Return To Contents

_WinAPI_PathIsNetworkPath

Author: guinness








ConsoleWrite(_WinAPI_PathIsNetworkPath("C:\") & @CRLF)

Func _WinAPI_PathIsNetworkPath($sFilePath)
    Local $aReturn = DllCall("shlwapi.dll", "int", "PathIsNetworkPathW", "wstr", $sFilePath)
    If @error Then
        Return SetError(1, 0, 0)
    EndIf
    Return $aReturn[0]
EndFunc   ;==>_WinAPI_PathIsNetworkPath

Return To Contents