无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 12484|回复: 30
打印 上一主题 下一主题

请教:如何用winimage的命令行提取img文件中的特定文件?【出现新问题,求解】

[复制链接]
跳转到指定楼层
1#
发表于 2007-5-27 10:09:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我只会提取img中的所有文件,能指定img中的目录及文件名吗?谢谢。
--------------------------
总结:
一,用批处理加入单个文件及目录。
示例:
path %Programfiles%\WinImage;d:\Program files\WinImage
rem 1,加入单个文件temp\MBR.bin到grub\gghost.img的根目录。
start  /wait /min WinImage grub\gghost.img temp\MBR.bin /i /h /y
rem 2,加入整个temp目录下的文件(含其下子目录)到grub\gghost.img的根目录。
start /wait /min WinImage grub\gghost.img temp /i /h /y  >nul

二,使用 /x 能提取包括子目录在内地的所有文件。但不能指定文件与目录。
WINIMAGE [source [destination] [options]]
使用参数:      /X      含义:Do Extract with sub-dir (second parameter can be destination)

三,使用winimage网站提供的免费软件extract释放img文件中的指定文件。
示例:
把gghost.img中根目录下的_pwda文件,dos目录下的cd83.bat文件和temp目录下的mbr.bin文件释放出来。
rem 1,释放img中根目录及子目录下文件到当前目录。
EXTRACT -e  gghost.img _pwda
EXTRACT -e gghost.img  mbr.bin
rem 2,释放img中子目录下文件到子目录下。
EXTRACT -x gghost.img cd83.bat

谢谢q8q8feng 和lxl1638 。
-------------------
使用中发现新问题,寻求帮助。
使用Extract能够从已有的img文件中提取指定文件。问题出现在使用Extract向img中添加后,无法把添加的文件再次提取出来。经多次测试后发现,这是仍能提取img中的其它文件,就是用它添加的文件取不出来。
附图中可看出,img中是有mbr.bin这个文件的,可是提取时却没有。(提取命令中把mbr.bin改成MBR.bin结果一样)
估计是使用方法问题。哪位高人知道的,麻烦给指点指点。谢谢了。

--------------
我的用例:

把当前目录下的mbr.bin文件加入gghost.img。
命令:
EXTRACT -i gghost.img mbr.bin /y


提取img文件中的mbr.bin到当前目录。
命令:
EXTRACT -l gghost.img
EXTRACT -e gghost.img mbr.bin



------------------
附上EXTRACT的帮助。
---------------
Extract NT - Extract file in wImage - V 2.10 (c) 1991-96 Gilles Vollant
Visit web page : http://ourworld.compuserve.com/homepages/gvollant/extract.htm
Usage:
      Extract -l <file> [<Files names>]             List file in an image
      Extract -e <file> [x:outpath] [<Files names>] Extract files
      Extract -x <file> [x:outpath] [<Files names>] eXtract files with pathname
      Extract -i <file> [<Files names>] [-Fnnn]     Inject files on an image
      Extract -b <file>                             Show boot sector information
       Using -oe or -ox instead -e or -x extract Overwriting existing files
       Using -it instead -i Truncate unused image part
       -Fnnn : size of image you want create (360,720,120,144,172,288...)

[ 本帖最后由 lianjiang 于 2007-5-29 05:17 PM 编辑 ]

snap027.jpg (50.22 KB, 下载次数: 114)

snap027.jpg

EXTRACT.rar

27.38 KB, 下载次数: 415, 下载积分: 无忧币 -2

2#
发表于 2007-5-27 10:14:10 | 只看该作者
原帖由 lianjiang 于 2007-5-27 10:09 AM 发表
请教:如何用winimage的命令行提取img文件中的特定文件?

我只会提取img中的所有文件,能指定img中的目录及文件名吗?谢谢。

可以的,点取文件,右键选择第二项,释放到指定的文件夹就可以了
回复

使用道具 举报

3#
发表于 2007-5-27 10:24:23 | 只看该作者

回复 #2 q8q8feng 的帖子

看清楚。是命令行。...
回LZ..我也只会你说的那个。...
回复

使用道具 举报

4#
发表于 2007-5-27 10:37:20 | 只看该作者
原帖由 lianjiang 于 2007-5-27 10:09 AM 发表
请教:如何用winimage的命令行提取img文件中的特定文件?

我只会提取img中的所有文件,能指定img中的目录及文件名吗?谢谢。

提供一下这个参数,你参考一下:
WINIMAGE [source [destination] [options]]

使用参数:      /X      含义:Do Extract with sub-dir (second parameter can be destination)
回复

使用道具 举报

5#
 楼主| 发表于 2007-5-27 11:07:55 | 只看该作者
原帖由 q8q8feng 于 2007-5-27 10:37 AM 发表

提供一下这个参数,你参考一下:
WINIMAGE [source [destination] [options]]

使用参数:      /X      含义:Do Extract with sub-dir (second parameter can be destination)

这个是提取包括子目录在内地的所有文件。不能指定参数。
回复

使用道具 举报

6#
发表于 2007-5-27 11:20:09 | 只看该作者
原帖由 lianjiang 于 2007-5-27 11:07 AM 发表

这个是提取包括子目录在内地的所有文件。不能指定参数。

的确,我也试了一下,但是它有
/I xxx : Inject file or directory xxx
可以往img文件中添加单个文件和文件夹功能,没有发现有释放单个文件或文件夹的功能的命令行;
我再查证一下,看有没有相关用法...wait....
回复

使用道具 举报

7#
 楼主| 发表于 2007-5-27 12:01:07 | 只看该作者
原帖由 q8q8feng 于 2007-5-27 11:20 AM 发表

的确,我也试了一下,但是它有
/I xxx : Inject file or directory xxx
可以往img文件中添加单个文件和文件夹功能,没有发现有释放单个文件或文件夹的功能的命令行;
我再查证一下,看有没有相关用法...wa ...

/I xxx 我也注意到了,可是参数还不会用。
谢谢,期待中。。
回复

使用道具 举报

8#
发表于 2007-5-27 16:23:53 | 只看该作者
原帖由 lianjiang 于 2007-5-27 12:01 PM 发表

/I xxx 我也注意到了,可是参数还不会用。
谢谢,期待中。。

to lianjiang:
(1)我举个使用“/I xxx”参数的例子:
假如winimage软件位于d分区;
2.txt是我们要植入img的文件;
img名称暂定为obj.img;
2.txt和obj.img都位于winimage下,即和winimage.exe同一目录下;

----------------------------------------------------------------------------------
cmd prompt:
进入wimimage下,执行:
winimage obj.img /i 2.txt /h
即可将2植入obj.img中,改变后的obj.img保存在当前目录下。
【注意】/h参数很重要,隐藏主窗口,不需要提示的默认进行,否则你运行命令行后会有提示。这仅仅是
实现“Inject file or directory xxx”到img中的命令行用法;

(2)经过搜集资料,依然没有找到如何提取单一文件的命令行参数;
我提供一个winimage的E文forum给你,也许对你有帮助,里面有人提出你提到的这个问题了,但这个帖子很久都没有得到答复,参阅其它帖子发现,好像就只有WINIMAGE自带的.hlp中的几个命令行参数了,也许我没有吃透,我继续关注这个问题吧

winimage forum web address:
http://forum.winimage.com

[ 本帖最后由 q8q8feng 于 2007-5-27 04:28 PM 编辑 ]
回复

使用道具 举报

9#
 楼主| 发表于 2007-5-27 16:57:12 | 只看该作者
原帖由 q8q8feng 于 2007-5-27 04:23 PM 发表

to lianjiang:
(1)我举个使用“/I xxx”参数的例子:
假如winimage软件位于d分区;
2.txt是我们要植入img的文件;
img名称暂定为obj.img;
2.txt和obj.img都位于winimage下,即和winimage.exe同一目录 ...

谢谢你。
发现winimage的命令行功能较弱,文件只能单个加入,不能用通配符。多文件的话,要么就是加入整个目录。
回复

使用道具 举报

10#
发表于 2007-5-27 17:03:21 | 只看该作者
原帖由 lianjiang 于 2007-5-27 04:57 PM 发表

谢谢你。
发现winimage的命令行功能较弱,文件只能单个加入,不能用通配符。多文件的话,要么就是加入整个目录。

是的。看来很难找到可释放单个文件或目录的命令行参数。
我用的是7.0,不知道新版本可有增强命令行使用的功能?

[ 本帖最后由 q8q8feng 于 2007-5-27 05:07 PM 编辑 ]
回复

使用道具 举报

11#
 楼主| 发表于 2007-5-27 17:15:03 | 只看该作者
用批处理加入单个文件及目录:
path %Programfiles%\WinImage;d:\Program files\WinImage
rem 1,加入单个文件temp\MBR.bin到grub\gghost.img的根目录。
start  /wait /min WinImage grub\gghost.img temp\MBR.bin /i /h /y
rem 2,加入整个temp目录下的文件(含其下子目录)到grub\gghost.img的根目录。
start /wait /min WinImage grub\gghost.img temp /i /h /y  >nul
回复

使用道具 举报

12#
 楼主| 发表于 2007-5-27 17:17:40 | 只看该作者
原帖由 q8q8feng 于 2007-5-27 05:03 PM 发表

是的。看来很难找到可释放单个文件或目录的命令行参数。
我用的是7.0,不知道新版本可有增强命令行使用的功能?

我用的是8.0。上午去winimage的网站,看到的帮助里(见后)好像也没有。
-------------------------------
Using WinImageYou can load an image into WinImage by either reading a floppy, reading an image file, or creating an empty image.
When an image is loaded, WinImage shows the files and directories present. You can change directories by double-clicking on the directory. You can return to the parent directory by double-clicking on the parent or first entry ("..").
WinImage can load an .ISO CD-ROM image file, in read only mode.
The image is loaded into memory. When there is no image loaded, some features are not available.
You can create a directory, delete or add files in the image from the toolbar or the Image menu option. You can use drag-and-drop from the Windows File manager to WinImage to inject data into an image, or from WinImage to another application to extract from it.
You can extract files in three ways: From the Image menu option or toolbar icon, by launching a file by double-clicking on it, or by dragging it to another application.
WinImage allows you to drag the image file from WinImage to another application by placing the mouse pointer onto the status bar or in the toolbar background. Press the left mouse button and keep it depressed, slide the pointer onto another application (drag and drop client), and release the mouse button. This original function allows you to add the image to a .ZIP or .ARJ file when using Nico Mak's WinZip utility, or attach the image to an e-mail created with Microsoft™ MS-Mail, or Lotus™ Notes or ccMail.
I suggest that you do not use the 820 KB or 1.72 MB formats, because Windows NT can not read them. I suggest that you use the DMF or the 1.68 MB format instead.
You can start WinImage with options in the command line:
'WINIMAGE [source [destination] [options]]'
'WINIMAGE file.ima' :Load the file file.ima
'WINIMAGE file.ima A:' :Load the file file.ima, write on A: and exit
'WINIMAGE A: file.ima' :Load from floppy A: and save file.ima
WINIMAGE /MAKESFX imagefilename.??z imagesfx.exe <command option>:Create a self-extractor file using a .wlz or .imz file, and with <command option> default option for the SFX file.
Option :
/F :Format when writing a floppy from the command line
/E :Do Extract (second parameter can be destination)
/X :Do Extract with sub-dir (second parameter can be destination)
/Q :Always exit after command line operation
/H :Hide the main WinImage window
/NX :Never exit after command line operation
/Nxxx :Create a new image (where xxx is DMF1024, DMF2048, 144, 120...)
/Txxx:Transform image size (where xxx is DMF1024, DMF2048, 144, 120...)
/I xxx :Inject file or directory xxx
/NOASPI :Disable the ASPI device checking in start (this disable CDRom image creation option under Windows 95/98/Me)
回复

使用道具 举报

13#
发表于 2007-5-27 17:21:58 | 只看该作者
原帖由 lianjiang 于 2007-5-27 05:15 PM 发表
用批处理加入单个文件及目录:
path %Programfiles%\WinImage;d:\Program files\WinImage
rem 1,加入单个文件temp\MBR.bin到grub\gghost.img的根目录。
start  /wait /min WinImage grub\gghost.img temp\M ...

恩,不错,这样用起来也挺方便...
/y参数在这里是?
回复

使用道具 举报

14#
发表于 2007-5-27 17:23:19 | 只看该作者
原帖由 lianjiang 于 2007-5-27 05:17 PM 发表

我用的是8.0。上午去winimage的网站,看到的帮助里(见后)好像也没有。
-------------------------------
Using WinImageYou can load an image into WinImage by either reading a floppy, reading an im ...

bbs.winimage.com论坛也没有有关解释
回复

使用道具 举报

15#
发表于 2007-5-27 17:32:02 | 只看该作者
原帖由 lianjiang 于 2007-5-27 05:15 PM 发表
用批处理加入单个文件及目录:
path %Programfiles%\WinImage;d:\Program files\WinImage
rem 1,加入单个文件temp\MBR.bin到grub\gghost.img的根目录。
start  /wait /min WinImage grub\gghost.img temp\M ...

这句:
start /wait /min WinImage grub\gghost.img temp /i /h /y  >nul
如果添加目录temp下的所有文件到gghost.img中,应该是这样吧:
start /wait /min WinImage grub\gghost.img  /i temp /h /y  >nul
你改动/i temp成为 temp /i会不会与
winimage [source][destination]这样的格式冲突?这点我没有试,呵呵
回复

使用道具 举报

16#
 楼主| 发表于 2007-5-27 18:09:03 | 只看该作者
原帖由 q8q8feng 于 2007-5-27 05:32 PM 发表

这句:
start /wait /min WinImage grub\gghost.img temp /i /h /y  >nul
如果添加目录temp下的所有文件到gghost.img中,应该是这样吧:
start /wait /min WinImage grub\gghost.img  /i temp /h /y  >nul ...

目录名在前在后都可以。已试过。 /y 是无提示覆盖同名文件。
回复

使用道具 举报

17#
发表于 2007-5-27 18:15:11 | 只看该作者
原帖由 lianjiang 于 2007-5-27 06:09 PM 发表

目录名在前在后都可以。已试过。 /y 是无提示覆盖同名文件。

:) 呵呵..
回复

使用道具 举报

18#
发表于 2007-5-27 18:38:07 | 只看该作者
WinImage官方还提供专门的命令行工具下载。
回复

使用道具 举报

19#
 楼主| 发表于 2007-5-27 18:50:37 | 只看该作者
原帖由 lxl1638 于 2007-5-27 06:38 PM 发表
WinImage官方还提供专门的命令行工具下载。

ok,去看看。
下载了Extract,用了一下,能提取指定文件。再摸索摸索,基本掌握用法后,再贴出来。
再次感谢。呵呵。

[ 本帖最后由 lianjiang 于 2007-5-27 07:14 PM 编辑 ]
回复

使用道具 举报

20#
 楼主| 发表于 2007-5-27 20:03:40 | 只看该作者
问题已解决。
总结见1楼。
回复

使用道具 举报

21#
发表于 2007-5-28 20:41:21 | 只看该作者
原帖由 lianjiang 于 2007-5-27 08:03 PM 发表
问题已解决。
总结见1楼。

很不错的,因为限于winimage的讨论,一开始有想到extract,但没有深究,错过了,呵呵...lianjiang兄给弄出来了,我看了下,这个extract是不是我们通常的那个extract.exe哦,我看是一个东西哦
回复

使用道具 举报

22#
发表于 2007-5-28 20:51:23 | 只看该作者
谢谢分享
已经学习了!!
回复

使用道具 举报

23#
 楼主| 发表于 2007-5-28 20:53:46 | 只看该作者
原帖由 q8q8feng 于 2007-5-28 08:41 PM 发表

很不错的,因为限于winimage的讨论,一开始有想到extract,但没有深究,错过了,呵呵...lianjiang兄给弄出来了,我看了下,这个extract是不是我们通常的那个extract.exe哦,我看是一个东西哦

从软件的帮助信息看,不是一个东西。

Microsoft (R) Cabinet Extraction Tool - Version (16) 1.00.603.0 (08/14/97)
Copyright (c) Microsoft Corp 1994-1997. All rights reserved.
EXTRACT [/Y] [/A] [/D | /E] [/L dir] cabinet [filename ...]
EXTRACT [/Y] source [newname]
EXTRACT [/Y] /C source destination
  cabinet  - Cabinet file (contains two or more files).
  filename - Name of the file to extract from the cabinet.
             Wild cards and multiple filenames (separated by
             blanks) may be used.
  source   - Compressed file (a cabinet with only one file).
  newname  - New filename to give the extracted file.
             If not supplied, the original name is used.
  /A         Process ALL cabinets.  Follows cabinet chain
             starting in first cabinet mentioned.
  /C         Copy source file to destination (to copy from DMF disks).
  /D         Display cabinet directory (use with filename to avoid extract).
  /E         Extract (use instead of *.* to extract all files).
  /L dir     Location to place extracted files (default is current directory).
  /Y         Do not prompt before overwriting an existing file.

------------------------------
Extract NT - Extract file in wImage - V 2.10 (c) 1991-96 Gilles Vollant
Visit web page : http://ourworld.compuserve.com/homepages/gvollant/extract.htm
Usage:
      Extract -l <file> [<Files names>]             List file in an image
      Extract -e <file> [x:outpath] [<Files names>] Extract files
      Extract -x <file> [x:outpath] [<Files names>] eXtract files with pathname
      Extract -i <file> [<Files names>] [-Fnnn]     Inject files on an image
      Extract -b <file>                             Show boot sector information
       Using -oe or -ox instead -e or -x extract Overwriting existing files
       Using -it instead -i Truncate unused image part
       -Fnnn : size of image you want create (360,720,120,144,172,288...)

Utilities from Gilles VOLLANT - 13 rue Mansart 91540 MENNECY - FRANCE
Internet : 100144.2636@compuserve.com

Extract is a freeware, but if you like this software, you can send me
$20 or 100 French Francs, and I send you WinImage, a very powerful Windows 3.1
and Windows NT shareware I wrote with a superset of Extract functionnality
回复

使用道具 举报

24#
 楼主| 发表于 2007-5-29 17:14:58 | 只看该作者
使用中发现新问题,寻求帮助。

使用Extract能够从已有的img文件中提取指定文件。问题出现在使用Extract向img中添加后,无法把添加的文件再次提取出来。经多次测试后发现,这是仍能提取img中的其它文件,就是用它添加的文件取不出来。
附图中可看出,img中是有mbr.bin这个文件的,可是提取时却没有。(提取命令中把mbr.bin改成MBR.bin结果一样)
估计是使用方法问题。哪位高人知道的,麻烦给指点指点。谢谢了。
--------------
我的用例:
把当前目录下的mbr.bin文件加入gghost.img。
命令:
EXTRACT -i gghost.img mbr.bin /y

提取img文件中的mbr.bin到当前目录。
命令:
EXTRACT -l gghost.img
EXTRACT -e gghost.img mbr.bin

snap027.jpg (50.22 KB, 下载次数: 48)

截图

截图

EXTRACT.rar

27.38 KB, 下载次数: 32, 下载积分: 无忧币 -2

软件

回复

使用道具 举报

25#
发表于 2007-5-31 03:16:05 | 只看该作者
Winimage有往img文件中添加单个文件或文件夹的功能:   /I xxx : Inject file or directory xxx
释放单个文件或文件夹的时候我们可以采用它的extract.exe来进行命令行释放;
是否这个extract使用在这个地方的时候有其它限制?这个值得思考一下:)
回复

使用道具 举报

26#
 楼主| 发表于 2007-5-31 06:37:28 | 只看该作者
原帖由 q8q8feng 于 2007-5-31 03:16 AM 发表
Winimage有往img文件中添加单个文件或文件夹的功能:   /I xxx : Inject file or directory xxx
释放单个文件或文件夹的时候我们可以采用它的extract.exe来进行命令行释放;
是否这个extract使用在这个地方的时 ...


确实能用winimage向img中添加文件,然后用extract提取。假如只用一个工具就更好。
我只所以提出这个问题,我是想把它用到我的gghost备份恢复工具里面。把软件生成的特定文件,自动加入到img中,需要时自动提取出来,从而增加一种对特定文件的保护手段。假如不能用extract(这个可以在软件包里提供)加入和提取,那就需要使用者安装了winimage才可实现了。

因为平时都是用winimage修改img文件,所以最初考虑的是用winimage,等发现winimage提取文件功能不是很好时,经高人提醒,下载了extract,确实能假如和提取指定文件,以为问题全解决了,再一用,才发现有时能提取,有时又不能提取,折腾了好长时间,才发现用extract不能提取自己加入的文件。很是奇怪。呵呵。
没法的话,只能增加判断,条件满足就使用,不满足就不用此功能。
不知有没有单文件,免注册的绿色winimage版本,呵呵。
回复

使用道具 举报

27#
发表于 2007-5-31 07:06:05 | 只看该作者
只要提取就不会得到保护,呵呵
回复

使用道具 举报

28#
 楼主| 发表于 2007-5-31 07:18:38 | 只看该作者
原帖由 弄潮儿-NET 于 2007-5-31 07:06 AM 发表
只要提取就不会得到保护,呵呵

确实如此,对高手而言无保护而言,不过对于他们,似乎也不需要保护,呵呵。
只是对新手来说提供一种可能而已。
不知有何比较理想的方法,来防止一个很小的文件被误删除。
1,目前采用的是用畸形目录。
2,即将采用的是增加加入img的方法。
3,考虑采用NTFS数据流。
4,还用一种不知是否可行,就是把该文本文件一某种方式转换后写入某一空闲扇区。

其实不管哪种我所想到的已会和仍不会操作的方法,都只是从防止误删除的角度考虑保护。
回复

使用道具 举报

29#
发表于 2007-5-31 23:17:39 | 只看该作者
原帖由 lianjiang 于 2007-5-31 06:37 AM 发表


确实能用winimage向img中添加文件,然后用extract提取。假如只用一个工具就更好。
我只所以提出这个问题,我是想把它用到我的gghost备份恢复工具里面。把软件生成的特定文件,自动加入到img中,需要时自动 ...

WinImage Pro 8.0.8000绿色汉化版可以使用的,你试试,在这个网站下载吧:http://www.xdowns.com
虽然绿色不安装,但是仍然需要加入提供的注册码,我试了下,不填入注册码,使用命令行会提示对话框的。

[ 本帖最后由 q8q8feng 于 2007-5-31 11:32 PM 编辑 ]
回复

使用道具 举报

30#
 楼主| 发表于 2007-6-1 12:45:03 | 只看该作者
原帖由 q8q8feng 于 2007-5-31 11:17 PM 发表

WinImage Pro 8.0.8000绿色汉化版可以使用的,你试试,在这个网站下载吧:http://www.xdowns.com
虽然绿色不安装,但是仍然需要加入提供的注册码,我试了下,不填入注册码,使用命令行会提示对话框的。

这个我也试过。我是把winimage.exe文件复制出来。然后卸载winimage,确实就会出现提示,需点一下ok。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2025-8-4 05:38

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表