Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Creating Folder in Batch File???
Name: Chris Knight Date: November 29, 2004 at 06:07:45 Pacific OS: Windows 2000 CPU/Ram: 1.6ghz
Comment:
Hello,
i'm trying to right a batch file that will create a new folder based on the system date (mm-dd-yy or mm-dd-yyyy). i'd also like to copy data into this folder after its created. i cant get it to work, and i'm not even sure i'm approaching it from the right angle. here is how my file looks right now:
c: cd test mkdir %DATE% move c:\test\DATA\*.* c:\test\%DATE%
the above is not working, and i've did some research on this site and cant really find what i'm looking for. has anyone ever did anything like this before? i'm pretty new to batch files in Windows 2000. thanks for any help or suggestions
Name: IVO Date: November 29, 2004 at 06:36:48 Pacific
Reply:
Try the following
Set FDate=%Date:~-10,10% Set Fdate=%FDate:/=-% MD C:\test\%FDate% Move C:\test\DATA\*.* C:\test\%FDate%
You have to process the returned %Date% as it is not directly suitable to be used as a folder/file name. On Computing Net there is a lot of examples about your issue: try XP, Programming, DOS Forum.
0
Response Number 2
Name: ramesh_sang Date: November 29, 2004 at 07:07:10 Pacific
Reply:
hi,
u just cut paste the following code, then it will really work out.
@echo off cd c:\temp set folder=%date:~10,4%%date:~7,2%%date:~4,2% mkdir %folder% move c:\temp c:\%folder%
bye ramesh
S. Ramesh chat: sramesh_sang@yahoo.com mail : rameshsa@infotech.stph.net
0
Response Number 3
Name: Chris Knight Date: November 30, 2004 at 05:09:34 Pacific
Reply:
Ramesh,
thank you very much for the reply. that works very well. it creates a folder, 20043011 for todays instance. one more quick question, if i change line 3 to look like this:
set folder=%date:~10,4%%date:~4,2%%date:~7,2%
instead of this:
set folder=%date:~10,4%%date:~7,2%%date:~4,2%
will todays folder now look like 20041130?
Chris
0
Response Number 4
Name: Chris Knight Date: November 30, 2004 at 05:13:20 Pacific
Reply:
Ramesh,
thanks for the reply, i just tried my question in the above post and it works great! thanks again!!
Summary: Hi, I am trying to organise a large group of music files. The files look as follows: Artist - Album - TrackNo. - Name.MP3 for example: Air - Moon Safari - 01 - All I Need.mp3 Is there any way of crea...
Summary: Hello All, We have a requirement to deploy a jpg file through a software mangement tool ( Radia ) to around 9000 clients in WAN. The need is that once this jpg file is deployed to the target client i...
Summary: Hello everyone. I am a very experienced computer user, however I have a problem now that I have never had to tackle. I have a bunch of files in a directory like this: xyz0101a.dwg I need to convert ...