Link to home
Start Free TrialLog in
Avatar of asgarcymed
asgarcymedFlag for Portugal

asked on

Create a Script to Automate UHA Command-Line Tool

Create a Script to Automate UHA Command-Line Tool

I  need to create a script (for example bat, vbs, wsf, or js) to automate the creation of Self-Extracting (SFX) UHA archives (.uha => .exe), using the command-line tool UHARC.EXE, but I am finding a lot of difficulties because the command-line arguments are aberrantly complex and long!...
Inside a main directory=folder I have many subfolders (each one has sub-subfolders); I need to compress each subfolder (inside the main folder), preserving the sub-subfolders architecture/path (inside compressed archives).  

Here is an example of what I tried at last:
{
uharc a -r+ -ed- -pr -m3 -mm+ -md+ -md4096 -b1024 "C:\Documents and Settings\ASUS_WinXPProSP2ENG\Desktop\XeroBank\000\xB-Browser\"
}

However UHARC.EXE crashes (command-line disappears) while making the compressed .uha archive; and I no SFX (.exe) is created...

Please help me!
Thanks in advance.
Best regards.
ASKER CERTIFIED SOLUTION
Avatar of L00M
L00M
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of asgarcymed

ASKER

Your comment is correct, and so it is indispensable, however not enough...

After making a lot of attempts/trials I became sure that two problems were happening:

1)As you previewed, a long path and/or containing spaces make errors! (both things are MS-DOS invalid; but pay attention  these are Win 32-bit executables (PE-EXE)!, however they have no GUI  so they may be referred as Command_line/Console/Terminal/Shell/Prompt tools, but they do not run inside MS-DOS nor Windows 3.X).

2)Another crucial problem is that the path's name cannot be finished with a back-slash (\)!
So C:\UHA is correct and C:\UHA\ in wrong.

After re-reading the help.doc file, I understood that is necessary a second command in order to create the sfx file, or either, convert .uha into .exe...

Here is an example of a successfully batch file:
{
uharc a -r+ -ed- -pr -m3 -mm+ -md+ -md4096 -b1024 "C:\UHA\Test\xB-Browser"
copy /b UHARCSFX.EXE+"xB-Browser.uha" "xB-Browser.exe"
del xB-Browser.uha
}

I will not close the question yet because I want to allow more useful comments, whichever they come from you or not (but you can be calm  your participation will be rewarded!).
I think I could solve the main problems, but I am still feeling that improvements are possible...
Any comments?
Thank you a lot!
Best regards.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
scrathcyboy -  I tested WinRAR, and it is very user-friendly, potent and efficient! It is much better than UHA, except in what respects to the compression ratio/efficacy. I may seem "paranoid" about the importance I give to the compression ratio/efficacy, but I have a solid reason to justify it - I need to upload 8 GB of files and my upload speed (stipulated by my ISP) is very, very low! I have an ADSL solution, and my download speed is good (330 KBytes/s) but my upload speed is miserable (27 KBytes/s). Thus, each MByte that is added to the upload queue, means much more time to upload! That's the reason why I want a super-compressor...
Thanks.
Best regards.  
Thanks for the points.
Post back here your final solution. I'd like to know if you can do better than RarSoft with the same reliability. :)
If you need the best compression -- try LHARC.EXE -- it is free, and is slow to compress, but beats everything for compression ratios.
Final conclusions - UHA has better compression ratio/efficacy than RAR but it is very unproductive to work with (command-line with lots and lots of arguments). WinRAR is very user-friendly, potent and efficient! If I need to compress many files in batch, maybe WinRAR will be better (more easy and quick; writing a long batch script for UHA would take a long time). If I have less files to compress, I will enjoy the UHA's strong compression.
LHArc - is almost like UHArc - superb compression ratio/efficacy but unproductive command-line...
Thanks.
Best regards.