Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Why Doesn't This Batch File Work?  (Read 11442 times)

0 Members and 1 Guest are viewing this topic.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: Why Doesn't This Batch File Work?
« Reply #30 on: November 22, 2014, 07:43:05 AM »
In the script that you so kindly wrote for me, the batch file and rawcomp have to be copied to temp\

Not at all.  The batch file can be launched from anywhere. :)

Change rawcomp to "c:\bin\rawcomp.exe" or where you have it located and then it will work from anywhere.



The folowing should solve the decompression - test it on sample-folders-and-files that are in a different folder.  Change the c:\temp

BTW, is d* the correct syntax for decompression?


EDITED: to handle the dNUMBER compression value.  Be sure to change c:\temp everywhere to the folder you are using.


Code: [Select]
@echo off
pushd "c:\temp" || (echo aborting - the folder doesn't exist & pause & goto :EOF)
if exist *.huf (echo Why are there *.huf files in the main folder? & pause & goto :EOF)
for /f "delims=" %%a in ('dir *.huf /b /s /a-d ') do (
   echo Working with "%%a"
      for %%b in ("%%~dpa\.") do (
          if exist  "%%~dpa\%%~na.rif" ("c:\bin\rawcomp.exe" d%%~nb "%%a" "%%~dpa\%%~na.rif" "%%~nb.raw" & rd /s /q "%%~dpa")
      )
)
popd
pause
« Last Edit: November 22, 2014, 08:01:34 AM by foxidrive »

gmgdr11

    Topic Starter


    Rookie

    • Experience: Experienced
    • OS: Windows 7
    Re: Why Doesn't This Batch File Work?
    « Reply #31 on: November 22, 2014, 07:50:49 AM »
    Not at all.  The batch file can be launched from anywhere. :)

    Change rawcomp to "c:\bin\rawcomp.exe" or where you have it located and then it will work from anywhere.



    The folowing should solve the decompression - test it on sample-folders-and-files that are in a different folder.  Change the c:\temp

    BTW, is d* the correct syntax for decompression?

    Code: [Select]
    @echo off
    pushd "c:\temp"
    if exist *.huf echo Why are there *.huf files in the main folder? & pause & goto :EOF
    for /f "delims=" %%a in ('dir *.huf /b /s /a-d ') do (
       echo Working with "%%a"
       if exist  "%%~dpa\%%~na.rif"   "c:\bin\rawcomp.exe" d* "%%a" "%%~dpa\%%~na.rif" "%%~na.raw" & rd /s /q "%%~dpa"
    )
    popd
    pause

    No, by d* I meant that the * is the filename of the rif/hup file. So in the following example:

    Code: [Select]
    8.hup
    the syntax would be

    Code: [Select]
    rawcomp d8 ...
    I apologize for not making that part clear.

    Also, thanks for the note about the original script. :)

    foxidrive



      Specialist
    • Thanked: 268
    • Experience: Experienced
    • OS: Windows 8
    Re: Why Doesn't This Batch File Work?
    « Reply #32 on: November 22, 2014, 08:05:09 AM »
    See my edited post above.  Test it as shown and see how it goes.

    If you use cygwin then the DLL will need to be on the path, I think.

    gmgdr11

      Topic Starter


      Rookie

      • Experience: Experienced
      • OS: Windows 7
      Re: Why Doesn't This Batch File Work?
      « Reply #33 on: November 22, 2014, 09:23:08 AM »
      See my edited post above.  Test it as shown and see how it goes.

      If you use cygwin then the DLL will need to be on the path, I think.

      Works great!

      Thank so very much for all your help.