It is not possible to do this using JavaScript, because it does not have the ability to work with the operating system.
however, this is a way to do this using VBScript (ASP.NET), but IE issues a security warning to the user before allowing code execution only if their security level is less than Medium-Low.
If you are trying to access local files over the Internet, it is best (except to detect vulnerabilities and gain access this way, i.e. a bad way) using Java or Flash.
If you still need code (for ASP / VBscript):
Dim FileSystem
Set FileSystem = GetObject("Scripting.FileSystemObject")
If Err.Number <> 0 Then
MsgBox("Error setting FileSystem object; check WSH version.")
WScript.Quit(0)
End If
Dim Folder
Set Folder = FileSystem.GetFolder("folder_name")
If Err.Number <> 0 Then
MsgBox("Error getting folder.")
WScript.Quit(1)
End If
-Carlos Nunez
source share