Zip with password

Hi All,

I am required to create multiple workbook each having multiple sheet. Can someone help to provide the code that can zip any files with password

Hi,

You can simply use the zip command

zip("myArchive.zip", 
    files="myFileToEncrypt.csv", 
    flags = "-P myPass")

The flags -P sets the password "myPass" in this case.

Remember that the password is only needed to extract the files. Viewing the list of files in the zip (but not the content of the files) can be done without password.

Hope this helps,
PJ

Thanks PJ for your response, I will try this and come back..

Regards
Saravana

Hi PJ,

Thanks, just got another work around, calling command prompt through R to compress with password.

Regards
Saravana

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.