Accessing mapped network drive from ColdFusion

Posted by Kip on Stack Overflow See other posts from Stack Overflow or by Kip
Published on 2010-05-21T20:20:56Z Indexed on 2010/05/24 16:31 UTC
Read the original article Hit count: 284

Filed under:
|
|
|

I am having a problem accessing a mapped drive in ColdFusion. I have \\server\files\sharing mapped to z:\. If I run this code, it says the directory exists for the full path but not for the mapped one:

<cfscript>
  fullPath = "\\server\files\sharing\reports";
  mappedPath = "z:\reports";

  WriteOutput("fullPath exists: #DirectoryExists(fullPath)#<br/>"); //YES
  WriteOutput("mappedPath exists: #DirectoryExists(mappedPath)#");  //NO
</cfscript>

I have done some Googling and have found a few people with the same problem, but the solution was always to use the full path. Is there a reason ColdFusion wouldn't be able to see or access the mapped drive? And if so, are there any workarounds (maybe a system call to get the full path of the mapped drive)?

© Stack Overflow or respective owner

Related posts about Windows

Related posts about networking