views:

47

answers:

3

I created a shortcut, in Windows, to a folder. I then placed this shortcut in another place. Using ASP, is it possible to list the files in the folder via the shortcut? All folders, files, links, etc. are on the same drive.

A: 

Classic ASP uses VBScript or JScript. If you can list the files with those, then you can do it in ASP.

John Saunders
A: 

IF the webhotel on the IIS has access rights through the filesystem, then it should be possible to simulate.

I've never seen anything but the windows desktop being able to use the shortcuts as is for anything else but shortcuts.

I've heard of some FTP servers using them though, dont know if it was special shortcuts or those made directly from within windows desktop.

BUT - if I had your problem, I would examine the fileformat for the shortcuts (.lnk) and look for syntax/ways to open these extensions from ASP through filesystem operations like "read file".

Then once you've retrieved the path from within the .lnk file, then you can do a simple "list files in a folder" with standard functions from the filesystem API.

BerggreenDK
One last thing: are you really sure you want to give access to any part of the IIS' harddrive? I hope its a personal project, as I would NEVER develop this kinda feature for a customer server - unless the read/write access were 100% checked and secured.
BerggreenDK
Is there an equivalent of symbolic links using ASP/javascript/vbscript to link to folders?
djdilicious
@djdilicious, Virtual directories in IIS
Gaby
@djdilicious would be nice to see you actually mark an answer if you are satisfied as thats how we know if your problem has been solved or not :o)
BerggreenDK
A: 

This might work but I must admit I hate using Shell object in ASP script:-

 Function ResolvePath(path)

     set wsh = CreateObject("WScript.Shell")
     set link = wsh.CreateShortcut(path)
     ResolvePath = link.TargetPath

 End Function
AnthonyWJones