Login | |
|
 |
RE: "File already exists" - Renaming files, h... - 7/25/2008 12:35:02 AM
|
|
 |
|
| |
TKS
Posts: 154
Score: 0
Joined: 5/16/2008
Status: offline
|
Oh wait... figured it out Function RenameSmilies() Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject") strNewName = inputbox("Would you like to change the name of the smiley you just clicked on?","Rename", objFSO.GetBaseName(nameb.value)) If strNewName = "" Then Elseif strNewName = objFSO.GetBaseName(nameb.value) Then Else Dim objFile : Set objFile = objFSO.GetFile("Smilies/" & nameb.value) If objFSO.FileExists("Smilies/"+strNewName+"."+objFSO.GetExtensionName(nameb.value)) Then msgBox "Error message : " + (nameb.value) + " already exists!" Else objFile.Name = strNewName & "." & objFSO.GetExtensionName(nameb.value) document.location.reload() End If End If End Function
|
|
| |
|
|
|
|
|