批量修改RAR文件注释的php代码
我们打开WINRAR的帮助文件,帮助文件中提到了在命令行模式下修改RAR文件注释及添加压缩文档的两个参数分别为A\C,WINRAR的说明文件如下:
从当前文件夹添加全部 *.hlp 文件到压缩文件 help.rar 中
WinRAR a help *.hlp
从文件添加注释可以使用 -z 开关。
WinRAR c -zinfo.txt dummy
这样,我们就可以通过PHP调用CMD,运行上述两个WINRAR参数来做到批量修改RAR文件的注释及添加压缩包的文件.需要注意的是,PHP在安全模式打开的情况下是不能直接调用CMD的.
下面的代码就是我通过我的数据库读取出文件路径并最终实现批量修改RAR文件注释的方法.因为数据库是ACCESS,我新建了一个ODBC源.同时RAR.exe及CMD.EXE都在1.PHP同目录下
复制代码 代码如下:
$id=$_GET[id];
if($id=="")
{
echo "参数错误";
exit;
}
if($id>=400)
{
echo "全部结束";
exit;
}
$db=odbc_connect("dw","","");
$sql="select * from 'download' where 'id'=$id";
$query=odbc_exec($db,$sql);
$filename=odbc_result($query,2);
if($filename=="")
{
}
$filename=str_replace("#1″,"",$filename);
$filename=str_replace("#2″,"",$filename);
$filename="soft/".$filename;
echo $filename."
";
if(!file_exists($filename))
{
echo "文件不存在,转到下一个ID";
$id++;
echo "
CONTENT='0;URL=../test/1.php?id=$id'>";
exit;
}//读出文件名,并检查文件是否存在
else
{
'WinRAR a $filename 使用说明.txt';
echo "插入说明文件成功";
$id++;
echo "";
}
odbc_close($db);
?>
××××××××××××××××××××
最近采集流行,可能许多朋友都尝试通过采集数据来建设一个内容丰富完善的站点.
可是,在某些时候我们通常采集得到的RAR文件都被批量加了注释,这个时候如果将这些数据放到自己的站上无异于为人家做广告.
最近我也碰到了这样的问题,为此大伤脑筋,后来仔细的翻看WINRAR的帮助文件发现我们可以通过下面的方法来做到批量修改.
我们打开WINRAR的帮助文件,帮助文件中提到了在命令行模式下修改RAR文件注释及添加压缩文档的两个参数分别为A\C,WINRAR的说明文件如下:
从当前文件夹添加全部 *.hlp 文件到压缩文件 help.rar 中
WinRAR a help *.hlp
从文件添加注释可以使用 -z 开关。
WinRAR c -zinfo.txt dummy
这样,我们就可以通过PHP调用CMD,运行上述两个WINRAR参数来做到批量修改RAR文件的注释及添加压缩包的文件.需要注意的是,PHP在安全模式打开的情况下是不能直接调用CMD的.
下面的代码就是我通过我的数据库读取出文件路径并最终实现批量修改RAR文件注释的方法.因为数据库是ACCESS,我新建了一个ODBC源.RAR.EXE及CMD.EXE都在1.PHP的相同目录下
复制代码 代码如下:
$id=$_GET[id];
if($id=="")
{
echo "参数错误";
exit;
}
if($id>=400)
{
echo "全部结束";
exit;
}
$db=odbc_connect("dw","","");
$sql="select * from 'download' where 'id'=$id";
$query=odbc_exec($db,$sql);
$filename=odbc_result($query,2);
if($filename=="")
{
}
$filename=str_replace("#1″,"",$filename);
$filename=str_replace("#2″,"",$filename);
$filename="soft/".$filename;
echo $filename."
";
if(!file_exists($filename))
{
echo "文件不存在,转到下一个ID";
$id++;
echo "
CONTENT='0;URL=../test/1.php?id=$id'>";
exit;
}//读出文件名,并检查文件是否存在
else
{
'WinRAR a $filename 使用说明.txt';
echo "插入说明文件成功";
$id++;
echo "";
}
odbc_close($db);
?>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



As an excellent compressed package manager, WinRAR is the graphical interface of the archive tool RAR in the Windows environment. WinRAR is suitable for backing up data, reducing the size of email attachments, decompressing RAR, ZIP and other types of files downloaded from the Internet, and can create new compressed files in RAR and ZIP formats. The WinRAR 32-bit version is popular among users Today, let me give you a detailed introduction to WinRAR 32-bit and how to set winrar to Chinese! 1. The Origin of WinRAR32-bit WinRAR32-bit is a Windows version of RAR compressed file manager. This is a program that allows you to create, manage and control

If you find event ID 55, 50, 140 or 98 in the Event Viewer of Windows 11/10, or encounter an error that the disk file system structure is damaged and cannot be used, please follow the guide below to resolve the issue. What does Event 55, File system structure on disk corrupted and unusable mean? At session 55, the file system structure on the Ntfs disk is corrupted and unusable. Please run the chkMSK utility on the volume. When NTFS is unable to write data to the transaction log, an error with event ID 55 is triggered, which will cause NTFS to fail to complete the operation unable to write the transaction data. This error usually occurs when the file system is corrupted, possibly due to the presence of bad sectors on the disk or the file system's inadequacy of the disk subsystem.

When logging into iTunesStore using AppleID, this error saying "This AppleID has not been used in iTunesStore" may be thrown on the screen. There are no error messages to worry about, you can fix them by following these solution sets. Fix 1 – Change Shipping Address The main reason why this prompt appears in iTunes Store is that you don’t have the correct address in your AppleID profile. Step 1 – First, open iPhone Settings on your iPhone. Step 2 – AppleID should be on top of all other settings. So, open it. Step 3 – Once there, open the “Payment & Shipping” option. Step 4 – Verify your access using Face ID. step

In Alibaba software, once you successfully register an account, the system will assign you a unique ID, which will serve as your identity on the platform. But for many users, they want to query their ID, but don't know how to do it. Then the editor of this website will bring you detailed introduction to the strategy steps below. I hope it can help you! Where can I find the answer to Alibaba ID: [Alibaba]-[My]. 1. First open the Alibaba software. After entering the homepage, we need to click [My] in the lower right corner; 2. Then after coming to the My page, we can see [id] at the top of the page; Alibaba Is the ID the same as Taobao? Alibaba ID and Taobao ID are different, but the two
![Event ID 4660: Object deleted [Fix]](https://img.php.cn/upload/article/000/887/227/168834320512143.png?x-oss-process=image/resize,m_fill,h_207,w_330)
Some of our readers encountered event ID4660. They're often not sure what to do, so we explain it in this guide. Event ID 4660 is usually logged when an object is deleted, so we will also explore some practical ways to fix it on your computer. What is event ID4660? Event ID 4660 is related to objects in Active Directory and will be triggered by any of the following factors: Object Deletion – A security event with Event ID 4660 is logged whenever an object is deleted from Active Directory. Manual changes – Event ID 4660 may be generated when a user or administrator manually changes the permissions of an object. This can happen when changing permission settings, modifying access levels, or adding or removing people or groups

Where can I check the Tencent Video ID? There is an exclusive ID in the Tencent Video APP, but most users do not know how to check the Tencent Video ID. Next is the graphic tutorial on how to check the Tencent Video ID brought by the editor for users who are interested. Users come and take a look! Tencent Video Usage Tutorial Where to check Tencent Video ID 1. First open the Tencent Video APP and enter the special area through [Personal Center] in the lower right corner of the main page; 2. Then enter the Personal Center page and select the [Settings] function; 3. Then go to Settings page, click [Exit Account] at the bottom; 4. Finally, you can view the exclusive ID number on the page shown below.

Vue cannot obtain the id attribute because getElementById is used in the "created()" hook function, and Vue has not completed mounting; the solution is to "created() {let serachBox = document.getElementById('searchBox') ;...}" code can be migrated to the "mounted()" hook function.

In today's era of rapid technological development, programming languages are springing up like mushrooms after a rain. One of the languages that has attracted much attention is the Go language, which is loved by many developers for its simplicity, efficiency, concurrency safety and other features. The Go language is known for its strong ecosystem with many excellent open source projects. This article will introduce five selected Go language open source projects and lead readers to explore the world of Go language open source projects. KubernetesKubernetes is an open source container orchestration engine for automated
