Need help on finishing off a .bat command

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
tweacle
Posts: 71
Joined: 11 Apr 2018 05:38

Need help on finishing off a .bat command

#1 Post by tweacle » 16 Apr 2018 09:31

Hi

I have the following bat command to 7zip my files but I need help in tweeting it a bit. I have

for /d %%X in (C:\Downloads) do "c:\Program Files\7-Zip\7z.exe" a "%%X.zip" "%%X\"

This is good as it zips the files but I need if poss something pop up telling me to rename the folder once it zipped and then password protecting it.

If I can do that maybe something like a text or message box advising to rename and password protect folder.

Thanks

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Need help on finishing off a .bat command

#2 Post by Squashman » 16 Apr 2018 09:44

You were told in your previous question how to get prompted to password protect the zip file.

tweacle
Posts: 71
Joined: 11 Apr 2018 05:38

Re: Need help on finishing off a .bat command

#3 Post by tweacle » 16 Apr 2018 09:47

sorry misread it

tweacle
Posts: 71
Joined: 11 Apr 2018 05:38

Re: Need help on finishing off a .bat command

#4 Post by tweacle » 16 Apr 2018 10:21

Sorry to be a pain

Its zipping the file OK and saving it in C:/Downloads.ZIP

How do I change it so it saves in a folder on C:/ called ZIPPED DOWNLOADS and puts the zipped folders in there?

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Need help on finishing off a .bat command

#5 Post by Squashman » 16 Apr 2018 10:48

So it is naming the zip file the name of the directory it is zipping. The folder name it is zipping is stored in this variable: "%%X".

So what would you do to this code: "%%X.zip" to add the output path to it?

Penpen showed you how to do it in your last thread.
viewtopic.php?f=3&t=8502#p56385

Post Reply