A bit tricky to explain which is why my Google-Fu is letting me down here, I'm basically trying to write a script that will scan a directory and copy the latest set of backups from it to another location. The backups will have the format something like:

```
backup-001
backup-001-i001
backup-001-i002
backup-001-i003
backup-002
backup-002-i001
backup-002-i002
backup-002-i003

```

etc. 

Where backup-001 is the full backup and backup-001-i001 is the first incremental and so on until the next full backup (backup-002) is run. 

I have the first part of the script sorted from a post on this site that will find the latest file and copy it:

```
pushd "\\nas\backup\bit-cw backup"
for /f "tokens=*" %%a in ('dir /b /od') do set newest=%%a
copy "%newest%" C:\test
popd

```

Now I need to find some way of having it find the newest file, which might be for example backup-035-i003 and for it to then copy all files matching backup-035\* to the new location, in other words it will copy the latest full backup plus all incrementals for that backup. 

I'm thinking I need to somehow take the filename it has determined is the newest and then remove the '-i00x' part, then use that new filename followed by a wildcard in the copy command but I'm hopelessly lost!!

Any help would be greatly appreciated!