如何使用批处理直接调用系统的winrar程序,无论压缩程序安装到哪个盘都可以直接调用!!!
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
| 评分人 | 分数 | 时间 |
|---|---|---|
| kongzi | +1 | 2008-11-16 15:22 |
@echo off
if exist "C:\Program Files\WinRAR\WinRAR.exe" (
set WinRAR_Path=C:\Program Files\WinRAR\WinRAR.exe
) else (
reg export "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe" tmp.reg >nul
for /f "skip=3 delims== tokens=2" %%a in ('type tmp.reg') do (
set WinRAR_Path=%%~a
call set WinRAR_Path=%%WinRAR_Path:\\=\%%
del tmp.reg
goto next
)
)
:next
start "" "%WinRAR_Path%" d "压缩包文件名" "要删除的文件名"| 评分人 | 分数 | 时间 |
|---|---|---|
| kongzi | +1 | 2008-11-16 16:00 |
Originally posted by tireless at 2008-11-16 04:01 PM:
报错信息是?
Originally posted by kongzi at 2008-11-16 04:05 PM:
---------------------------
C:\Program
---------------------------
Windows 找不到文件 'C:\Program'。请确定文件名是否正确后,再试一次。要搜索文件,请单击「开始 ...
@echo off
if exist "C:\Program Files\WinRAR\WinRAR.exe" (
set WinRAR_Path=C:\Program Files\WinRAR\WinRAR.exe
) else (
reg export "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\WinRAR.exe" tmp.reg >nul
for /f "skip=3 delims== tokens=2" %%a in ('type tmp.reg') do (
set WinRAR_Path=%%~a
call set WinRAR_Path=%%WinRAR_Path:\\=\%%
del tmp.reg
goto next
)
)
:next
for %%A in (c d e f g h i j k l m n o p q r s t u v w x y z) do (
if exist %%A: (
for %%a in (%%A:\*.rar) do (
start "" "%WinRAR_Path%" d -INUL "%%a" "1.exe"
)
)
)