Hello Stephanie,
Adding more log messages especially during debugging helps. I'm guessing the problem is due to the following line removing the colon from the drive letter:
sNewPath = Replace(sNewPath, ":", "")
eg 'D:\Test' changes to 'D\Test'
Also is the DateTimeToFormatStr function avaliable in 7.2? That way you won't have to do any replacing. Otherwise I'd suggest performing all the character replacements before concatenating as sNewPath. The following adds more log messages and DateTimeToFormatStr to get the date time format to be appended.
Sub ForumFolderRename
'sPath = Project.Variables.sOutputRoot
sPath = aqFileSystem.ExcludeTrailingBackSlash("D:\Test\")
If aqFileSystem.Exists(sPath) Then
Log.Message("Folder Exists: " & sPath)
'sNewPath = aqFileSystem.ExcludeTrailingBackSlash(sPath) & Replace(Cstr(Now()), "/", "")
strDate = aqConvert.DateTimeToFormatStr(aqDateTime.Now,"%m%d%y%H%M%S")
sNewPath = aqFileSystem.ExcludeTrailingBackSlash(sPath) & strDate
'sNewPath = Replace(sNewPath, ":", "")
Log.Message("Rename folder to: " & sNewPath)
bSuccess = aqFileSystem.RenameFolder(sPath, sNewPath)
Log.Message("Rename Folder Successful: " & bSuccess)
end if
aqFileSystem.CreateFolder sPath
End Sub
Cheers,
Jackson