PC Review
Forums
Newsgroups
Windows 2000
Microsoft Windows 2000 Developer
Creating a folder for today's Date
Forums
Newsgroups
Windows 2000
Microsoft Windows 2000 Developer
Creating a folder for today's Date
![]() |
Creating a folder for today's Date |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I am trying to create a folder for today's date in a
batch file. I am using the command md "%date%". in the command window it display the flowing, E:\System State>md "Mon 07/14/2003". However when you view the folder the folders name is Mon 07. I know this is because you can not use / in folder names. Is there a way I can get the the the date to generate with dashes instead of /? ie. Mon 07-14-2003 Thanks Micheal |
|
|
|
#2 |
|
Guest
Posts: n/a
|
>-----Original Message----- >I am trying to create a folder for today's date in a >batch file. I am using the command md "%date%". in the >command window it display the flowing, E:\System >State>md "Mon 07/14/2003". However when you view the >folder the folders name is Mon 07. I know this is >because you can not use / in folder names. Is there a >way I can get the the the date to generate with dashes >instead of /? ie. Mon 07-14-2003 > >Thanks > >Micheal >. > Micheal, Use this vbscript copy and paste the text to text fileand rename the file to .vbs) '-------------------------- start ------------------------ Set objFSO = CreateObject("Scripting.FileSystemObject") dim fold GetCurrentDate = FormatDateTime(Date, 2) dim c,d for x=1 to 10 c=mid(GetCurrentDate ,x,1) if c="/" then d=d&"-" else d=d&c end if next 'msgbox d Set objFolder = objFSO.CreateFolder("c:\" & d) '-------------------------- end ------------------------- for more files and folder script you can visit my site at : http://scripts.mutsonline.com Best Regards Oren Nizri |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

copy and paste the text to text file
