Modify the name of the file and the asp code to modify the name of the folder. Modify the name of the file.
Use the GetFile function of FileSystemObject to get a file object, and then modify the name attribute of the file object.
Copy the code code as follows:
set fso=Server.CreateObject(Scripting.FileSystemObject)
set file=fso.GetFile(Server.MapPath(/folder/old_name.asp))
file.name=new_name.asp
Change the name of the folder
Use the GetFolder function of FileSystemObject to get a folder object, and then modify the name attribute of the folder object.
Copy the code code as follows:
set fso=Server.CreateObject(Scripting.FileSystemObject)
set file=fso.GetFolder(Server.MapPath(/folder/old_name.asp))
file.name=new_name.asp