Jump to content

Recommended Posts

Posted

I'm trying to create some self-extracting winRAR archives to install some of my programs, and I've been able to create them fine manually, but I'm having trouble finishing them from the command line utility. I can create the sfx archive itself just fine, but then when I try to add comments to it from a file, I cannot get them to add. The "date modified" on the archive updates to the current time, but the comments aren't actually in it.

The file I'm trying to call the comments from is "comment.txt" and looks like:

;The comment below contains SFX script commands

Path=strokeit
SavePath
Setup=strokeit.cmd
Silent=1
Overwrite=1

I've also tried naming this comment file with different extensions (or no extension) with the same results.

To add the comments to an existing sfx archive, I understand the correct syntax to be the first one here, but I've tried all these and none work:

rar cf folder\existingarchive.exe comment.txt
rar c folder\existingarchive.exe comment.txt
rar cf comment.txt folder\existingarchive.exe
rar c comment.txt folder\existingarchive.exe

So, does anybody know what I'm doing wrong here? This is driving me insane, it seems like it aught to be so simple... and it probably is.

Thanks in advance!


Posted

The rar commandline tool is named rar32.exe, so I'm assuming you have renamed it.

rar c -zcomment.txt folder\existingarchive.exe

Posted

Actually, I haven't renamed anything, and i just searched my computer and there's no "rar32.exe" on it. All I've done is added "C:\Program Files\WinRAR\" to the "paths" variable, so now I can simply use the "rar" command from any command prompt or batch file.

The syntax you gave there works for me, Thanks so much! That's very interesting. I'd tried it almost that way, but without the z. How on earth did you ever know to add that? Is there a guide somewhere I've overlooked?

Posted (edited)

Ah, I thought you meant RAR for Dos when you mentioned "the command line utility". :)

The 'guide' I use is WinRAR.hlp. :D

WinRAR Help > Contents >> Command line mode >> Commands >> "C" Add an archive comment
b) Comments may be added from a file by using the -z<file> switch.
WinRAR c -zinfo.txt dummy

You can also use rar /? from commandline.

Edited by nakira
Posted

Son of a gun!! I should have looked through that help before, I guess I don't always think all the way. (I know you can use rar /? at the command line, but its information is limited.) Well thanks for helping me with something I should have found on my own!

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...