Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Could be this done?

wasimxe wrote:

your zip command with specific path and same name as directory is working fine but could be done via prompt box,

I am trying this

zip -r "!?&Enter an Archive Name:?/backup/archive.zip!" !&

I want to replace "archive" here with same name as directory which I am going to create zip.

Thanks

Your duplicate post:
https://winscp.net/forum/viewtopic.php?p=79170#79170
wasimxe

Could be this done?

your zip command with specific path and same name as directory is working fine but could be done via prompt box,

I am trying this

zip -r "!?&Enter an Archive Name:?/backup/archive.zip!" !&

I want to replace "archive" here with same name as directory which I am going to create zip.

Thanks
martin

Re: How to use custom command to zip a folder?

zip -r "!-`date +%Y%m%d%H%M`.zip" "!/"
MGM

Re: How to use custom command to zip a folder?

martin wrote:

I do not understand your "ZIP folder" command. It seems wrong.

Anyway to ZIP selected folder, use zip -r "!.zip" "!". This way you cannot pack more folders into one archive.


How to add timestamp to zip archive?

Like: folder ==> zip into ==> folder-timestamp.zip
higgins

The gzip command won't recursively clamp a catalog into a solitary compress record, when utilizing the -r switch. Rather it will walk that registry structure and compress each one document that it finds into a different record.
Akari

Thank you,prikryl!

I just notice i din't check the box "Apply to directories",
after check it, the command is working!! That y alot of command dint run for me..
Sorry my bad english, and thank for your patient to solve my problem. You help me alot, thank again!
martin

Re: How to use custom command to zip a folder?

Akari wrote:

Not working for me

That's not very helpful statement. What does it do? Any error message?
Did you check the Apply to directories option?
Akari

Re: How to use custom command to zip a folder?

Not working for me,
Is there anything require by the server?
But i tried
 zip -r "a!.zip" "!/"
in folder /WWW/abc/
and i selected 123 folder, the output is zip the /WWW/abc/ in a.zip file.
martin

Re: How to use custom command to zip a folder?

I do not understand your "ZIP folder" command. It seems wrong.

Anyway to ZIP selected folder, use zip -r "!.zip" "!". This way you cannot pack more folders into one archive.
Akari

How to use custom command to zip a folder?

I know how to zip a file with
zip -r "!?&File(&A):?archive.zip!" !&
and i know how to zip a folder with
zip -r "!?File(&A):?archive.zip!" !& "!?Folder(&A):?folder name!" !&
But is there a way to zip a select folder without typing any archive name or folder name?
e.g if i selected folder name abc once i rune the command it will create a zip file name abc.zip