0

i need to write a bat file which can give me the last names of files in a network folder.The names has the specific pattern.simmilar to this pattern.

Deepak.DEMO.yyyymmdd mcapatna.POWERHOUSE.yyyymmdd 

where Deepak.DEMO & mcapatna.POWERHOUSE are fixed but yyyymmdd is variable depends on the year month & date.

  1. I have to find this yyyymmdd using batch programming &
  2. if possible than compare it with current date.if it is today date then proceed further otherwise move these file to different folder. I tried a lot but i am unable to do it.could someone please help me.
1
  • Please put the code you have tried so far with your question... For getting the files with "yyyymmdd" given, you can use the dir /b *.<yyyymmdd> command. Check the /b switch at dir /?. Commented Jun 2, 2016 at 19:41

1 Answer 1

1
for %%i in (Deepak.DEMO.* mcapatna.POWERHOUSE.*) do echo %%~xi 

See here for a possible solution to get the date in the same format. Comparing for equality should be trivial.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.