Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2150
  • Last Modified:

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.
0
asgarcymed
Asked:
asgarcymed
  • 3
  • 2
  • 2
2 Solutions
 
L00MCommented:
I wasn't familiar with UHARC. Wow, it's a bit slower, but has amazing compression.

Anyway.... I ran the command line exactly like you have it above, except I used a different path, and it worked perfectly.

Because it's DOS based, I'm wodering if that long path might be bombing it. Try copying a few files to c:\test\ and try it there. Does it work for trivial cases? Then move a subfolder in there to make sure it's recursing properly. Keep increasing the complexity until it breaks, but always start with a case where it works.

Lemme know.
0
 
asgarcymedAuthor Commented:
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.
0
 
scrathcyboyCommented:
You are dealing with an outdated, quirky, badly tested product.  Get up with the modern compression programs.  WINRAR is definitiely the best, it can handle essentially every compression program written that was worth its salt.  If winrar does not do it, it is obsolete.  Compression percentage is irrelevant compared to reliability.  Many people stick with unreliable compression programs and jeopardize their data for it..  
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
asgarcymedAuthor Commented:
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.  
0
 
L00MCommented:
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. :)
0
 
scrathcyboyCommented:
If you need the best compression -- try LHARC.EXE -- it is free, and is slow to compress, but beats everything for compression ratios.
0
 
asgarcymedAuthor Commented:
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.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now