ASP FileSystemObject -> GetFolder: Not playing nice with IIS 10

Forgive me for not knowing too much about this; but here goes:

We are moving our intranet server from whatever WS2003 had to IIS10. The intranet server basically accesses our network drives to look for clients, files and all that so the users can easily navigate and access what they need without going through explorer.

We gave our intranet a new face, and put it on a new WS2016 server. Everything works except for one thing. When this .asp page requests a listing of any folder on the network, it does not like spaces. At all. We’re dumbfounded by this. Quotes are there, everything should be as it is.

<% '***************** Folder Dim fso, folder, subFolders, folderObject, folderPath Dim yearArray Dim I, curRecords, clientpath Dim handle dim folder_exists on error resume next folder_exists = false handle = replace(Request.ServerVariables("AUTH_USER"), "OURDOMAIN", "") if left(request("clientnumber"),2) = 28 then Set fso = CreateObject("Scripting.FileSystemObject") Set folder = fso.GetFolder("\pathtoparentclient data" & left(request("clientName"), 1) & "" & replace(request("clientName") & " - " & request("clientNumber"), "/", "_")) if err.number = 0 then folder_exists = true Set subFolders = folder.SubFolders for each folderObject in subFolders %> <form action="<%= folderObject.Name %>Folder.asp" method="get" style="display:inline"> <input type="hidden" name="clientNumber" value="<%= request("clientNumber") %>"> <input type="hidden" name="clientName" value="<%= request("clientName") %>"> <% select case UCase(Left(folderObject.Name,1)) & Mid(folderObject.Name,2) case "CW","Tax", "Correspondance" response.write "<input type=""submit"" style=""width:191px"" value="""& UCase(Left(folderObject.Name,1)) & Mid(folderObject.Name,2) &""">" case else %> <input type='button' style='width:191px' name='browse' value='<%= UCase(Left(folderObject.Name,1)) & Mid(folderObject.Name,2) %>' onClick=window.location.href='file://path/to/client%20data/<%= left(request("clientName"), 1)%>/<%= replace(replace(replace(replace(replace(request("clientName") & " - " & request("clientNumber"), "+", "%2B"), " ", "%20"), ",", "%2c"), "/", "_"), "'", "%27") %>/<%= replace(UCase(Left(folderObject.Name,1)) & Mid(folderObject.Name,2), " ", "%20") %>/'> <% end select %> </form><br> <% Next else response.write "Client Folder Does Not Exist" end if if folder_exists then %> <input type='button' style='width:191px' name='Browse Client' value='Browse Client' onClick=window.location.href='file://path/to/data/client%20data/<%= left(request("clientName"), 1)%>/<%= replace(replace(replace(replace(replace(request("clientName") & " - " & request("clientNumber"), "+", "%2B"), " ", "%20"), ",", "%2c"), "/", "_"), "'", "%27") %>/'><br> <br> <% end if %> 

Really stumped about this. Works on the old server but something with IIS 10 isnt let it play nice.

Any help is appreciated!

submitted by /u/RumRogerz
[link] [comments]

Leave a Reply