|
Answer» Please help me to create folder with PREVIOUS date
Thanx in advance Previous as in yesterday? What FORMAT MM-DD-YYYY CODE: [Select]Option Explicit Dim objFSO,d,path Set objFSO=CreateObject("Scripting.FileSystemObject") d=Split(DateAdd("d", -1, Now)," ")(0) path="c:\temp\"&Replace(d,"/","-") If Not objFSO.FolderExists(path) Then objFSO.CreateFolder(path) End If
OUTPUT: Code: [Select]C:\temp> dir /B
C:\temp>cscript /nologo c:\vbscript\createFolderOnPreviousDate.vbs
C:\temp>dir /B 8-21-2007
C:\temp>dir Volume in drive C has no label. Volume Serial Number is F453-C43D
Directory of C:\temp
08/22/2007 05:46 PM <DIR> . 08/22/2007 05:46 PM <DIR> .. 08/22/2007 05:46 PM <DIR> 8-21-2007 0 File(s) 0 bytes 3 Dir(s) 609,329,152 bytes free
Dear DeltaSlya any format of dateDear ghostdog74
Thanx for the help But,I am not getting where code is to be inserted and the output ?Quote from: mitameet on August 24, 2007, 12:41:45 AM Dear ghostdog74
Thanx for the help But,I am not getting where code is to be inserted and the output ?
its difficult for me to help you when you just tell me that, without desribing what you did, your environment , your code especially, etc...you should provide enough details of your output for US to help you.
|