导航:首页 > 程序命令 > windowszip命令

windowszip命令

发布时间:2022-10-03 02:57:52

A. 在windows下用python调用zip命令,不知道是哪里错了,就是运行不了

windows 自带zip这个命令吗,没听说过。

不如进入命令提示符,直接输入命令,看有没有这个命令

不如用下面的代码

# -*- coding: cp936 -*-
import zipfile
import time
import os
def addfoldertozip(folder,myzipfile):
for filename in os.listdir(folder):
subpath=os.path.join(folder,filename)
if os.path.isfile(subpath):
myzipfile.write(subpath)
elif os.path.isdir(subpath):
addfoldertozip(subpath,myzipfile)
else:
raise TypeError("非法文件类型")
source = [r'D:\My Documents']
target_dir='E:\\exercise\\'
target=target_dir+time.strftime('%Y%m%d%H%M%S')+'.zip'
myzipfile=zipfile.ZipFile(target,'w')
for folder in source:
addfoldertozip(folder,myzipfile)
myzipfile.close()

当然D:\My Documents和E:\exercise两个文件夹必须存在才能正确运行。

B. 电脑怎么压缩

打开【小丸工具箱】,将要压缩的视频拖入软件,点击【压制】对视频进行压缩;打开【迅捷压缩】,点击【图片压缩】,点击【添加文件】将图片导入,点击【开始压缩】可以压缩图片;再右键点击要压缩的文件,选择【添加至压缩文件】,可以进一步压缩文件。

你是否需要通过电子邮件给别人发送多份文件?想把旧图片打包起来,节省电脑上的空间?担心他人窥探你的重要文档?将文件制成压缩文件,能帮助你节省电脑空间、整理大量文件,还能加密重要、敏感的各类材料文件。查阅本文,了解如何在Windows电脑和Mac电脑上创建ZIP压缩文件。

方法 1 的 4:
Windows电脑
1
创建一个新文件夹。想要压缩多个文件,最快捷的的方式就是将你想压缩的所有文件和文件夹归档到一个文件夹里,再把这个文件夹压缩成ZIP文件。
重命名文件夹,将这个文件夹压缩后,会以原来文件夹的名字来命名ZIP文件。将文件夹的名字改成你想给ZIP文件起的名字。
2
右键单击文件夹。将鼠标光标悬停在“发送到”选项上,这会打开一个新的子菜单。选择“压缩(zipped)文件夹”。
你也可以在资源管理器中选中多个文件,右键点击一个文件,然后按照上面的步骤进行操作。这样压缩出的ZIP文件就会包含所有选中的文件,并以你右键点击的文件名来命名ZIP文件。
3
等待系统创建新的压缩文件。如果你一次性压缩了大量文件,那么系统需要花费一段时间来压缩它们,创建新的ZIP文件。你能在窗口中看到一个进度栏,显示文件添加的进度。完成压缩后,会在原始文件夹所在的路径下出现ZIP压缩文件。[1]
广告
方法 2 的 4:
Mac OS X系统
1
创建文件夹。想要创建ZIP文件,最快捷的方法就是将你想归档的文件放到同一个文件夹中。你可以在要创建成ZIP文件的文件夹中,放入任意数量的文件和文件夹。
将文件夹命名为ZIP文件的文件名。
2
右键点击文件夹。点击“压缩”选项,文件夹就会被压缩为ZIP文件。新的ZIP文件和原文件夹在同一个位置。
你也可以在文件资源管理器中选择多个文件,然后点击右键,重复上述步骤。生成的ZIP文件中会包含你选择的所有文件,并且命名为“存档.zip”。
广告
方法 3 的 4:
Linux系统
1
打开终端。它的符号像是一个带有一些明亮字母的黑色三角形。在一些平台上,它被称作Konsole、xTerm或类似的名字。
2
创建一个目录。这可以通过mkdir命令来完成,能把目录名称当做一个自变数。比如,你要创建一个名为“zipArchive”的目录,那就输入mkdir zipArchive。
3
把所有要在ZIP文件里包含的文件移动或复制到目录中。
使用mv命令可以移动文件。这意味着文件将从原来的位置移动到你指定的位置。
使用cp命令可以复制文件。这样会把文件复制到你指定的位置,而文件还是保留在它原本的位置。请注意,你需要使用cp -r来复制目录。
两个命令都会把原位置当做第一个自变数,要复制或移动到的位置当做第二个自变数。例如,要把名为“textToArchive.txt”的文件移动到目录“zipArchive”,那就输入:mv textToArchive.txt zipArchive
4
压缩目录。这可以通过zip -r命令来实现。它会把压缩文件的名称当做第一个自变数,而要压缩的文件夹名称是第二个自变数。比如,要把目录“zipArchive”压缩成名为“zipArchive.zip”的文件,那就输入:zip -r zipArchive.zip zipArchive。这样会输出所有添加到压缩包中的文件名,这样你就能检查是否所有的文件都已包括在压缩文件中。
广告
方法 4 的 4:
受密码保护的ZIP文件
1
下载压缩程序。在新版本的Windows系统中,不借助其它软件,就无法创建受密码保护的ZIP文件。压缩软件既有免费的,也有收费的,除了能够创建受密码保护的ZIP文件之外,你并不需要其它“花哨”的功能。下面是一些常用的软件:
7-Zip
IZArc
PeaZip
2
新建压缩文件。使用压缩软件新建ZIP文件。在软件中添加你要压缩的文件。当你创建ZIP文件时,软件会给你提供一些选项,其中就有密码输入选项。你需要使用你输入的密码打开该ZIP文件。
3
在OS X系统中创建受密码保护的ZIP文件。要在OS X系统中创建受密码保护的ZIP文件,你可以使用“终端”程序,无需下载其它程序。首先,将要归档的所有文件放到一个文件夹中,然后将文件夹命名为ZIP文件的文件名。
打开“终端”。你可以在“应用”文件夹中的“工具”文件夹中找到它。
找到要压缩的文件夹位置。
输入以下命令:
zip –er <文件夹名>.zip <文件夹名>/*
创建密码。系统会提示你输入相同的密码两遍来确认操作。输完密码之后,就创建好你的ZIP文件了。[2]
广告
小提示
在资源管理器或WinZip文件导航窗口中按下Ctrl(Control)键,点击多个文件来一次性选择多个文件。

C. winzip命令行打包文件夹,要加什么参数,才能不包含文件夹的路径到zip中

应该不直接支持你说的功能,间接的办法是list一个文件表。不过你文件多了话还是没办法。你可以看网上的教程。

What command line parameters does WinZip support?

Below is some information about the undocumented command line options for using the WinZip program mole, winzip32.exe.

WinZip supports command line options to add and extract from files. Be sure to read the Notes section below for additional important information.
Adding Files

The command format is:

winzip32 [-min] action [options] filename[.zip] files

where:

-min specifies that WinZip should run minimized. If -min is specified, it must be the first command line parameter.

action
-a for add, -f for freshen, -u for update, and -m for move. You must specify one (and only one) of these actions. The actions correspond to the actions described in the section titled "Add dialog box options" in the online manual.

options
-r corresponds to the Include subfolders checkbox in the Add dialog and causes WinZip to add files from subfolders. Folder information is stored for files added from subfolders. If you add -p, WinZip will store folder information for all files added, not just for files from subfolders; the folder information will begin with the folder specified on the command line.

-ex, -en, -ef, -es, and -e0 determine the compression method: eXtra, Normal, Fast, Super fast, and no compression. The default is "Normal". -hs includes hidden and system files. Use -sPassword to specify a case-sensitive password. The password can be enclosed in quotes, for example, -s"Secret Password".

filename.zip
Specifies the name of the Zip file involved. Be sure to use the full filename (including the folder).

files
Is a list of one or more files, or the @ character followed by the filename containing a list of files to add, one filename per line. Wildcards (e.g. *.bak) are allowed.
Extracting Files

The command format is:

winzip32 -e [options] filename[.zip] folder

where -e is required.

options
-o and -j stand for "Overwrite existing files without prompting" and "Junk pathnames", respectively. Unless -j is specified, folder information is used. Use -sPassword to specify a case-sensitive password. The password can be enclosed in quotes, for example, -s"Secret Password".

filename.zip
Specifies the name of the Zip file involved. Be sure to specify the full filename (including the folder).

folder
Is the name of the folder to which the files are extracted. If the folder does not exist it is created.

Notes

* VERY IMPORTANT: always specify complete filenames, including the full folder name and drive letter, for all file IDs.

* To run WinZip in a minimized inactive icon use the "-min" option. When specified this option must be the first option.

* Only operations involving the built-in zip and unzip are supported.

* Enclose long filenames in quotes.

* When using a list ("@") file, no leading or trailing spaces should appear in file IDs in the list.

* The action and each option must be separated by at least one space.

* WinZip can be used to compress files with cc:Mail . Change the compress= line in the [cc:Mail] section of the appropriate WMAIL.INI files to specify the full path for WinZip followed by "-a %1 @%2". For example, if WinZip is installed in your c:\winzip folder, specify

compress=c:\winzip\winzip.exe -a %1 @%2

D. 如何在windows xp命令行下把文件压缩成zip文件

压缩一个文件:
makecab c:\filename.txt c:\filename.zip

解压一个文件:
expand c:\filename.zip c:\filename.txt

注:实际得到的文件是cab

E. windows如何用cmd命令解压指定的zip文件到指定目录里

使用cmd中的命令解压压缩文件到任意文件夹的方法如下:

1、复制RAR.exe和UNRAR复制到c:windows文件夹中。

F. 谁能告诉我解压缩文件的WINZIP怎么使用

对于可解压的文件只要选中点鼠标右键就有解压菜单了!
建议你还是使用 winrar 吧,支持的格式比较多,虽然有时候压缩 rar 格式比 zip 格式慢些,但如果设置好了好多时候会压缩比率更大一些!
最主要的是 winzip 解不了 rar ,而 winrar 可以解 zip !

G. win7如何使用zip命令压缩一个csv。

win7使用zip压缩一个csv:

1、选中CSV文件,鼠标右键选择添加到压缩文件;

2、点浏览,选择压缩路径;

压缩文件格式:选中ZIP,点确定。

H. Winzip应该用什么方式打开

(1)打开注册表编辑器regedt32.exe。
(2)打开hkey_classes_root根键。
(3)单击注册表编辑器菜单栏的“编辑”→“查找”,系统将打开“查找”对话框。在该对话框中的“查找目标”文本框中输入.zip,然后将查找对象设为“项”,单击“查找下一个”按钮开始查找。
(4)在系统找到了名称为.zip的键后,展开该键,进入到其子键shellnew下,将除了“默认”键值项以外的所有键值项全部删除。
(5)重启计算机,可以看到“新建”菜单中已经没有winzip
file命令了。

I. windows中zip的解压缩命令

直接下载winrar解压缩软件就可以了。

可以使用使用腾讯电脑管家安装软件,打开管家后,在选项卡中搜索winrar软件,点击该软件行的安装按钮,管家会自动的从网络下载软件并安装。

可以选择多个软件安装,在下载过程中,您可以暂停和取消(但进入安装过程后,可能无法取消),并可以随时恢复下载。软件下载完成后,会自动调用该软件的安装向导,可以在安装过程中进行必要的设置,如安装到哪个目录,是否安装附加选项等。

阅读全文

与windowszip命令相关的资料

热点内容
delphi入门pdf 浏览:417
岛国片app 浏览:955
电影院维语版。 浏览:298
php订单代码 浏览:35
区域卷积神经网络Python 浏览:298
重生井冈山参加红军的小说 浏览:589
linux文件系统编程 浏览:876
怀孕神片 浏览:815
8排影院哪个位置好 浏览:906
程序员对链底端的影响 浏览:470
html5socketphp 浏览:86
excel怎样编程 浏览:977
php正则不匹配 浏览:138
垃圾桶怎么连接服务器 浏览:665
21号染色体值算法公式 浏览:248
传入传出的linux命令 浏览:535
罂粟电影剧情 浏览:840
龙口设计图纸加密联系方式 浏览:141
怎么看加密狗是否到期 浏览:239
楚雄用什么app做公交划算 浏览:751