1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Skip files in batch files

Discussion in 'DOS/Other' started by gsr45, Apr 30, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. gsr45

    gsr45 Thread Starter

    Joined:
    Apr 30, 2012
    Messages:
    2
    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
     
  2. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,731
    Code:
    FOR /F "tokens=* delims=" %%G in ('dir /a-d /b /s .*.* ^| findstr /V /C:".odbc.ini"') do attrib +h "%%G"
     
  3. gsr45

    gsr45 Thread Starter

    Joined:
    Apr 30, 2012
    Messages:
    2
    Thanks Squashman, it worked nicely. Went thru some the codes you used and have understood how you've used it..thanks!
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1051375