VBS create rar files. - Geeks to Go Forums

Jump to content

Log in Register Register Malware removal guide How it works

VBS create rar files. Can't get one file to go unpassworded.

#1 IO-error

  • Group: Member
  • Posts: 276
  • Joined: 10-March 06

Posted 07 November 2010 - 04:54 AM

Hi there fellow geeks.

I'm wondering how to get this result with VBS:

Quote

FileName.rar Containing:
Picture01.jpg*
Picture02.jpg*
Picture03.jpg*
Picture04.jpg*
Password.txt
ReadMe.txt*


Note, Password.txt not having a star and thus not having a password.
I have tried a wide variety of switches and also made a lot of google searches for a few days, but I can't find it.

So basically, I'm wondering what switches, syntax and order I have to put the command, in order to achieve the "Password.txt" to be accessible without password.
Thank you for you time in advance.

***EDIT***
Oh, I'm not trying to make fake rars that you see at download centra.
I'm trying to use this for my work, to easily and most of all safely, store back-ups of customers.
The password in the Password.txt is encoded with my own unique encoding script and is only decodable by my own decode script.

#2 IO-error

  • Group: Member
  • Posts: 276
  • Joined: 10-March 06

Posted 08 November 2010 - 12:02 PM

I found out how to do it.
So, here it is:
Set sh = CreateObject("WScript.Shell")
	sh.run("""C:\Program Files\WinRAR\Rar.exe"" a -m5 -en " &Bdir &" " &PassFile)	'Bdir is location to save the rarfile to.
		Wscript.Sleep 100	'You know what this does.
	sh.run("""C:\Program Files\WinRAR\Rar.exe"" a -m5 -ed -p" &Pass &" " &Bdir &" " &Target)'Pass is the password to encode with, Target is the dirs to save.


"-en" will prevent the rarfile to close.
"-ed" leaves out empty directory's.
"-m5" max compression ratio.

This seemed the right way to do what I wanted.
I hope others have some use of this.

Share this topic: