arimakidd Posted April 4, 2009 Share Posted April 4, 2009 I need to move xml files from folderA to folderB. Before the are moved to folderB I need to create a subfolder in B that is named according to system date and time. I have the code to move the files from folderA to folderB: move /y C:\folderA\*.xml C:\folderB\ I have the code that creates a new folder and names it according to system time stamp of year,month,day_hours,minutes,seconds: REM Create sub directory called \yymmdd_hhmmss REM where yymmdd_hhmmss is a date_time stamp like 030902_134200 set hh=%time:~0,2% REM Since there is no leading zero for times before 10 am, have to put in REM a zero when this is run before 10 am. if "%time:~0,1%"==" " set hh=0%hh:~1,1% set yymmdd_hhmmss=%date:~12,2%%date:~4,2%%date:~7,2%_%hh%%time:~3,2%%time:~6,2% md D:\batch-programming\%yymmdd_hhmmss% how do I marry the two? I need to move the file to the newly created subfolder named from timestamp in folderB. Quote Link to comment https://forums.phpfreaks.com/topic/152598-batch-programming-problem/ Share on other sites More sharing options...
arimakidd Posted April 4, 2009 Author Share Posted April 4, 2009 I managed to solve the problem myself. I completely overlooked the fact that the lines that create the new folder stores the name(date time stamp) in a variable. You can then just call this variable or use it in your path where you are moving the files to. Quote Link to comment https://forums.phpfreaks.com/topic/152598-batch-programming-problem/#findComment-801452 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.