Script needed to encrypt a zip file

I would like to run a script, which will look at a specific folder in a path (ie C:\users\user1\desktop\desktop.zip), and encrypt that zip file with a password.
is this possible, please let me know.
100questionsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ITguy565Commented:
I would use something like the following :
https://gallery.technet.microsoft.com/scriptcenter/EncryptDecrypt-files-use-65e7ae5d

#Create Key
$key = New-CryptographyKey -Algorithm AES
 
#Encrypt the file
Protect-File '.\secrets.txt' -Algorithm AES -Key $key -RemoveSource
 
#Decrypt the file
Unprotect-File '.\secrets.txt.AES' -Algorithm AES -Key $key -RemoveSource
0
ITguy565Commented:
Did that work for you?
1
AlanConsultantCommented:
Hi,

Probably worth noting that you can encrpyt a zip file when it is created, so you don't need to do it separately.

7-Zip (for example) allows AES-256 encrpytion, with a password based key.

Alan.
0
Hey MSSPs! What's your total cost of ownership?

WEBINAR: Managed security service providers often deploy & manage products from a variety of solution vendors. But is this really the best approach when it comes to saving time AND money? Join us on Aug. 15th to learn how you can improve your total cost of ownership today!

ITguy565Commented:
@100Questions:

Did you get a chance to test?
0
Gerwin Jansen, EE MVETopic Advisor Commented:
Already suggested by Alan, a command you can use for 7zip command line:

<path to executable>\7z a C:\users\user1\desktop\desktop_protected.7z C:\users\user1\desktop\desktop.zip -pSECRET

SECRET is your password

You can add the optional -sdel parameter at the end to remove the .zip file once the .7z file has been created.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AlanConsultantCommented:
Good options provided.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.