获得驱动器路径 <cfscript> /** * Returns the path for the specified drive. (Windows only) * * @param drvPath Drive letter (c, c:, c:\) or network share (\\computer\share). * @return Returns a string. * @author Rob Brooks-Bilson (rbils@amkor.com) * @version 1.0, July 19, 2001 */ function DrivePath(drvPath) { Var fso = CreateObject("COM", "Scripting.FileSystemObject"); Var drive = fso.GetDrive(drvPath); Return drive.Path; } </cfscript> <CFSET TheDrive = "S"> <CFOUTPUT> The path for the #TheDrive# drive is #DrivePath(TheDrive)# </CFOUTPUT> |