# Solved: Skip files in batch files



## gsr45 (Apr 30, 2012)

Hi,
Am currently mapping a samba drive to windows and am trying to get rid of the dot files that appears on the mapped window directory. So i wrote a batch file that has 

for %%G in (.*.*) do attrib +h /s /d %%G 

When i run this batch file, it returns with a access denied on this file, .odbc.ini. Am trying to skip that file so that the above cmd will work. Have tried various ways but could not skip that file. Any help will be appreciated. thanks


----------



## Squashman (Apr 4, 2003)

```
FOR /F "tokens=* delims=" %%G in ('dir /a-d /b /s .*.* ^| findstr /V /C:".odbc.ini"') do attrib +h "%%G"
```


----------



## gsr45 (Apr 30, 2012)

Thanks Squashman, it worked nicely. Went thru some the codes you used and have understood how you've used it..thanks!


----------

