Snippets ( Network ): Difference between revisions
Jump to navigation
Jump to search
m (+Snippets Category (+ normalize top)) |
|||
Line 1: | Line 1: | ||
__TOC__ | __TOC__ | ||
[[category:Snippets]] | |||
{{Snippet Credit Header}} | |||
===== <blockquote style="background-color:white; padding:1em; border:2px solid #8FBC8F">''' _IsNetworkShare() ~ Author - [http://www.autoitscript.com/forum/user/35302-guinness/ guinness] '''</blockquote> ===== | ===== <blockquote style="background-color:white; padding:1em; border:2px solid #8FBC8F">''' _IsNetworkShare() ~ Author - [http://www.autoitscript.com/forum/user/35302-guinness/ guinness] '''</blockquote> ===== | ||
Revision as of 15:17, 12 November 2012
; Check if a path is a network drive.
ConsoleWrite( _IsNetworkShare(@ScriptDir) & @CRLF)
Func _IsNetworkShare($sFilePath)
Return (Not StringMid($sFilePath, 2, 1) = ":")
EndFunc ;==>_IsNetworkShare
_WinAPI_PathIsNetworkPath() ~ Author - guinness
_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