Micro Focus QTP (UFT) Forums
How can i use Now statement to create folder - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How can i use Now statement to create folder (/Thread-How-can-i-use-Now-statement-to-create-folder)



How can i use Now statement to create folder - Kishore_J - 01-29-2011

Hi Frds,

Can i know the script for create a folder with Current date.


Thanks,



RE: How can i use Now statement to create folder - sreekanth chilam - 01-29-2011

Hi Kishore,

Here we go !!

Code:
Dim fso, f
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.CreateFolder("c:\"&replace(replace(now,"/","-"),":","-"))
   NewFolder_Path= f.Path
   NewFolder_Name=f.Name
   msgbox NewFolder_Path
   msgbox NewFolder_Name



RE: How can i use Now statement to create folder - Kishore_J - 01-31-2011

Thank you very much Sreekanth..Smile


RE: How can i use Now statement to create folder - DinakarVadapalli - 01-31-2011

Code:
Dim fso, f
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.CreateFolder("c:\New Folder")
   CreateFolderDemo = f.Path