FOR statement using NOT on a file

Discussion in 'Software' started by vgerdj, Dec 6, 2008.

  1. vgerdj

    vgerdj Private E-2

    I want to write a batch that finds all the '.txt' files NOT matching D_

    how would I modify the code below


    FOR /r C:\myfolder\ %%f in (D_*.txt) DO

    --tnx
    DJ
     
  2. PEBKAC

    PEBKAC Private First Class

    Would something like this work for you?...

    Code:
    for /f "tokens=1 delims=*" %%f in ('dir /b /s C:\myfolder\*.txt^|find /i /v "\D_"') do @echo %%f
    
     
  3. vgerdj

    vgerdj Private E-2

    What I'm trying to do is: open a bunch of Cad files and save them as blocks in a number of folders so I can see the thumbnails, as AutoCad before 2000 didn't do thumbnails. The problem is, I can't get the code just right.
    dwg\arch
    dwg\furn\tbl
    dwg\furn\chair
    dwg\lanscape\tree
    dwg\lanscape\shrub
    ...

    this works:

    FOR /r C:\CAD\BLKS\dwg\ %%f in (*.dwg) DO START /WAIT C:\"Program Files"\"Autocad Land Desktop 2008"\acad.exe /p "DJK_MAP" /nologo "%%f" /b C:\CAD\BLKS\wbout.scr

    before the above FOR statement, the original code had

    md C:\CAD\BLKS\dwg\arch\wb

    but it didn't make additional wb subfolders.

    what I was trying to do is save the file with a D_ (for detail) and then copy the file I wanted to a symbol library

    there are 7500 files. A lot of files are the same content but different names, or the same name in different folders and different content.

    I can modify the script and LISP code to save the CAD file but how do I create a wb folder in each subdirectory? I did try a FOR with MD but it didn't work.

    tnx
    DJ
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds