Results 1 to 12 of 12

Thread: I need a better version of sweep.exe

  1. #1
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts

    I need a better version of sweep.exe

    i need a better version of sweep that doesn't not dedtroy my " in my command line.

    e.g.

    sweep for %i in (*.png) do pngbest "%i"

    then i want it to goddamn run

    for %i in (*.png) do pngbest "%i"

    in every folder and not just

    for %i in (*.png) do pngbest %i

    The problems is files with spaces and my batch file which relies on %1 parameter

  2. #2
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Location
    Kharkov, Ukraine
    Posts
    3,134
    Thanks
    179
    Thanked 921 Times in 469 Posts
    Try
    sweep for %i in (*.png) do pngbest ^"%i^"

  3. #3
    Member m^2's Avatar
    Join Date
    Sep 2008
    Location
    Ślůnsk, PL
    Posts
    1,612
    Thanks
    30
    Thanked 65 Times in 47 Posts
    Quote Originally Posted by SvenBent View Post
    i need a better version of sweep that doesn't not dedtroy my " in my command line.

    e.g.

    sweep for %i in (*.png) do pngbest "%i"

    then i want it to goddamn run

    for %i in (*.png) do pngbest "%i"

    in every folder and not just

    for %i in (*.png) do pngbest %i

    The problems is files with spaces and my batch file which relies on %1 parameter
    What is sweep.exe for?
    Isn't
    Code:
    for /r %%i in (*.png) do pngbest "%%i"
    what you're looking for?

  4. #4
    Member
    Join Date
    May 2008
    Location
    France
    Posts
    78
    Thanks
    436
    Thanked 22 Times in 17 Posts
    You have many batches for png optimizing such as pngslim (by Andrew C.E. Dent), optimipng (by Joachim Kluge), ...

    Look at Ken Silverman's board

  5. #5
    Member
    Join Date
    May 2008
    Location
    England
    Posts
    325
    Thanks
    18
    Thanked 6 Times in 5 Posts
    PNGslim is a great freeware batch, but if you spend the cash then you can still get better results with pngoutwin, although it's only by a few bytes No doubt there will be some circumstances though were another programs slightly different approach will yield better results though.

  6. #6
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts
    I'm not in a need of a png optimizing. i allready have that

    btw the
    For /R seems to works like a charm for this specific task.

    but i still need a way to run a command for each directory and sub directory. (not for each file)


    something like this

    sweep packjpg *.pjg


    this command line works but if i could use a For statement in my batch instead i would save some bytes and have a nicer archieve with less files



    i know that i can use the FOR /R to run packjpg on each files but that slower then running packjpg *.pjg in each directory.

  7. #7
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Location
    Kharkov, Ukraine
    Posts
    3,134
    Thanks
    179
    Thanked 921 Times in 469 Posts
    as i said, ^" can be used in windows for quoting the same way as you'd use \" in unix.

  8. #8
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts
    Quote Originally Posted by Shelwien View Post
    as i said, ^" can be used in windows for quoting the same way as you'd use \" in unix.

    Sorry dont get you.
    I'm now looking for a solutions without the usage of sweep.exe

    seems like

    FOR /D


    should do the trick but i cannot get it to work



    BTW usin gthe ^ did not help

    i still seem like my pngbest.bat file recives its %1 without quotes so it doesn't handles filenames with spaces.


    if i scroolback i con confirm this the issued command in my command bokx are

    pngbest.bat concept Warrior.png

    and til should have been

    pngbest.bat "concept Warrior.png"



    this issues comes when i'nside the bat is running pngout %1 as it only recieves Concept and no the rest of the file name.

    maybe i cna fix it with just adding %2 %3 %4 inside Quotes in the .bat file
    Last edited by SvenBent; 27th October 2008 at 10:06.

  9. #9
    Member m^2's Avatar
    Join Date
    Sep 2008
    Location
    Ślůnsk, PL
    Posts
    1,612
    Thanks
    30
    Thanked 65 Times in 47 Posts
    Quote Originally Posted by SvenBent View Post
    Sorry dont get you.
    I'm now looking for a solutions without the usage of sweep.exe

    seems like

    FOR /D


    should do the trick but i cannot get it to work



    BTW usin gthe ^ did not help

    i still seem like my pngbest.bat file recives its %1 without quotes so it doesn't handles filenames with spaces.


    if i scroolback i con confirm this the issued command in my command bokx are

    pngbest.bat concept Warrior.png

    and til should have been

    pngbest.bat "concept Warrior.png"



    this issues comes when i'nside the bat is running pngout %1 as it only recieves Concept and no the rest of the file name.

    maybe i cna fix it with just adding %2 %3 %4 inside Quotes in the .bat file
    Could you post the script? It would be easier this way.
    BTW %* is better than enumerating parameters. Shorter and compatible with more than 9.

  10. #10
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts
    This is my pngbest.bat
    Code:
    @ECHO OFF
    
    For %%i in (0,1,2,3,4,5) do  pngout %1  /f%%i /r
    
    
    For %%i in (0,64,128,192,256,384,512,768,1024) do pngout %1 /b%%i /r
    
    
    advpng -z -4 %1
    
    Deflopt.exe %1
    i need to run this on all files in a directory three containing several thousands .PNGs at around 12GB in total size
    many of the filenames contains spaces

    Typing
    for %i in (*.png) do pngbest "%i"
    in the command box works perfectly for that one folder

    However using Sweep for %i in (*.png) do pngbest "%i"
    Does not. It simply seems to forget the " around %i

    Doing Sweep for %i in (*.png) do pngbest ^"%i^"
    Does not work either
    Last edited by SvenBent; 27th October 2008 at 23:27.

  11. #11
    Member m^2's Avatar
    Join Date
    Sep 2008
    Location
    Ślůnsk, PL
    Posts
    1,612
    Thanks
    30
    Thanked 65 Times in 47 Posts
    Code:
    for /r %%A in (.) do call :start %~dpnA
    goto :eof
    
    :start
    cd %1
    pngbest
    goto :eof
    ?

  12. #12
    Administrator Shelwien's Avatar
    Join Date
    May 2008
    Location
    Kharkov, Ukraine
    Posts
    3,134
    Thanks
    179
    Thanked 921 Times in 469 Posts
    then what about
    Sweep "for %i in (*.png) do pngbest "%i""
    Also i'd say it should be "call pngbest"

Similar Threads

  1. exe prefilter quick comparison
    By evg in forum Data Compression
    Replies: 7
    Last Post: 23rd May 2009, 16:20
  2. New Disassembled LZTurbo.exe 0.92...
    By Raymond_NGhM in forum Forum Archive
    Replies: 1
    Last Post: 19th April 2008, 08:58
  3. Disassembled LZTurbo.exe 0.92...
    By Raymond_NGhM in forum Forum Archive
    Replies: 10
    Last Post: 17th April 2008, 14:29
  4. RASH - EXE-cryptor
    By encode in forum Forum Archive
    Replies: 21
    Last Post: 11th February 2008, 11:53
  5. rash - dummy EXE packer
    By encode in forum Forum Archive
    Replies: 17
    Last Post: 26th January 2008, 12:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •