Problem description:
Run OK on my local machine and OK on the Server at the beginning. It won't work if FrontPage Server Extensions (FPSE) 2002 is installed. Now I have uninstalled FPSE. This is the complete code,
dim XMLPathXMLPath= server.mappath("/") & "fdp\"& month(now) & "-" & day(now) & " " & hour(now) & "-" & minute(now) & "-" & second(now)Set fso = CreateObject("Scripting.FileSystemObject") response.write "<br/>OKK1111111111111" & XMLPathfso.createFolder(XMLPath) response.write "<br/>OKK2222222222222" & XMLPathfso.createFolder(XMLPath & "\configuration")response.write "<br/>OKK33333333333333" & XMLPathXMLPath=XMLPath & "\configuration"fso.createFolder(XMLPath & "\parameter")fso.createFolder(XMLPath & "\wallpapers")fso.createFolder(XMLPath & "\sounds")fso.createFolder(XMLPath & "\sounds\alarms")fso.createFolder(XMLPath & "\sounds\notifications")fso.createFolder(XMLPath & "\sounds\ringtones")fso.createFolder(XMLPath & "\sounds\ui")response.write "<br/>OKK444444444444" & XMLPath
Cause and solution:
In addition, some execution problems occur because
1. Because the Scripting. FileSystemObject object is not registered,
Solution:
Register scrrun. dll again
For example, when the supervisor starts, enter "regsvr32.exe % windir %/system32/scrrun. dll" in "---“runtime", Press enter, and re-register the FSO object.
Test method: We recommend that you use the alicloud probe to test the FileSystemObject component on your current server;
2. Use the error detection mechanism to identify the cause of the problem
On Error Resume Next 'fso. createFolder (XMLPath) Error line content If Err. number <> 0 thenresponse. write "you cuo wu" %> error Number: <% = Err. number %> <br/> error message: <% = Err. description %> <br/> error file: <% = Err. source %> <br/> error line: <% = Err. line %> <br/> <% = Err %> end ifOn Error Goto 0
This can be used to detect errors. For error numbers, see the Description corresponding to ASP Err. Number.
For more information about post-installation articles, see the MSDN article: IIS Question and Answer-January 1, August 2003
3. Use the following methods to detect
Function MD(strSysPath) On Error Resume Next Dim i Dim objFSO Dim arrPath Dim strNoncePath MD = True Set objFSO = Server.Createobject("Scripting.FileSystemObject") If Not objFSO.FolderExists(strSysPath) Then arrPath = Split(strSysPath, "\") strNoncePath = arrPath(0) For i = 1 To UBound(arrPath) strNoncePath = strNoncePath & "\" & arrPath(i) If objFSO.FolderExists(strNoncePath) Then Else objFSO.CreateFolder strNoncePath End If Next End If Set objFSO = Nothing If Err.Number <> 0 Then MD = False On Error Goto 0End Function
Sample Code: response. write MD (XMLPath & "\ sounds") 'true indicates success; False indicates failure.
Finally, ASP is really outdated ......