Mount [v1.0]

作者: Tuncay 最近更新时间: 20100305


Mount is a wrapper function to the Windows system core program subst reference.

Mount([SourcePath], [Mountpoint], [Options])
Mount_GetMount([Path])
Mount_GetMountPathes([Variable])
Mount_UnMount([Mountpoint], [Options])

关于函数的参数和返回值, 请参阅其源码.

备注

subst.exe: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/subst.mspx

关于此函数(集)的更新细节和注意事项, 请参见 AutoHotkey 论坛: http://www.autohotkey.com/forum/viewtopic.php?t=17090

许可

此函数(集)是基于 GNU LGPL 许可的开源项目. 想了解许可详情, 请参见 lgpl-3.0.txt

示例

; #Include Mount.ahk
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

; Select source folder
FileSelectFolder, SourcePath, ::{20d04fe0-3aea-1069-a2d8-08002b30309d}, 3, Select folder to mount

If (ErrorLevel = 0)
{
	; Mount to first free drive
	path := Mount(SourcePath)

	; Open that drive and wait until MsgBox is closed for unmount
	MsgBox %SourcePath% mounted to %path%
}

Mount_GetMountPathes(pathes)
If (pathes != "")
{
	MsgBox, 4,, Unmount all these mounts?`n`n%pathes%
	IfMsgBox, Yes
	{
		Loop, Parse, pathes, `n
		{
			StringLeft, path, A_LoopField, 1
			If (path)
			{
				Mount_UnMount(path)	
			}
		}
	}
}