# Solved: WinRAR SFX and batch



## Codiah (Sep 27, 2008)

Ok, so this is a question i've been looking for the answer for, for some time.. is there some way to run a command in a batch file that will open a winrar self extracting file, input your password and unpack the file? i dont know if winrar has a command line parameter for this or not, or if theres some type of general one... or if there's a way to open a normal self decrypting archive in the .sda.exe format from the command prompt...

any answers would be much appreciated..


----------



## Codiah (Sep 27, 2008)

Ok well, after allot of digging through files and the internet, i found that there is a command for winrars SFX password-ed files to open them from the command line, and i figured i'd go ahead and share if anyone else had any interest...

filename.exe -p<password> *///note: password goes immediatly after the "p" without a space between them.*

this would be usefull in an .exe file, if you include the SFX archive as an included file when you compile the exe, you can have the exe extract the file, insert the password and unpack the archive.. this would keep sensitive information safe if you were using multiple batch files outside of a parent exe... it obviously would still be viewable, but only after you input the password to allow the script to run..

if it were as simple as wanting to lock files from prying eyes, i would just recomend using the SFX archive,no point in making a file if your just trying to hide something, but it does have some small advantages in the viewpoint of unpacking usable source files for your parent exe file..

anyway, i should stop rambeling and get some sleep, g'night everyone..


----------

