PHP Code _php Tutorial for bulk modification of RAR file annotations

Source: Internet
Author: User
We open the WinRAR Help file, the Help file mentioned in the command line mode to modify the RAR file comments and add a compressed document two parameters are A\c,winrar the following:
Add all *.hlp files from the current folder to the compressed file Help.rar

WinRAR a Help *.hlp

To add comments from a file, you can use the-Z <文件> Switch.
WinRAR C-zinfo.txt Dummy

In this way, we can call cmd through PHP, run the above two winrar parameters to bulk modify RAR file comments and add compressed package files. It is important to note that PHP cannot invoke cmd directly when Safe mode is turned on.

The following code is the way I read the file path through my database and eventually implement the bulk modification of RAR file annotations. Because the database is access, I created an ODBC source. RAR.exe and CMD.EXE are all in the same directory 1.PHP
Copy CodeThe code is as follows:
$id =$_get[id];
if ($id = = "")
{
echo "Parameter Error";
Exit
}
if ($id >=400)
{
echo "All over";
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 "File does not exist, go to the next ID";
$id + +;
echo "

content= ' 0; Url=. /test/1.php?id= $id ' > ';
Exit
}//read out the file name, and check that it exists
Else
{
' WinRAR a $filename instructions for use of. txt ';
echo "Insert description file succeeded";
$id + +;
echo " ";
}
Odbc_close ($DB);
?>


Xxxxxxxxxxxxxxxxxxxx
Recent collection of popular, many friends may try to collect data to build a rich and comprehensive site.
At some point, however, the RAR files that we usually collect are commented in batches, and if you put the data on your station, you can advertise it for others.
Recently I have encountered such a problem, this big headache, and then carefully look at WinRAR's help file found that we can use the following methods to do batch modification.
We open the WinRAR Help file, the Help file mentioned in the command line mode to modify the RAR file comments and add a compressed document two parameters are A\c,winrar the following:
Add all *.hlp files from the current folder to the compressed file Help.rar
WinRAR a Help *.hlp

To add comments from a file, you can use the-Z <文件> Switch.
WinRAR C-zinfo.txt Dummy

In this way, we can call cmd through PHP, run the above two winrar parameters to bulk modify RAR file comments and add compressed package files. It is important to note that PHP cannot invoke cmd directly when Safe mode is turned on.

The following code is the way I read the file path through my database and eventually implement the bulk modification of RAR file annotations. Because the database is access, I created an ODBC source. RAR.EXE and CMD.EXE are in the same directory as 1.PHP
Copy CodeThe code is as follows:

$id =$_get[id];
if ($id = = "")
{
echo "Parameter Error";
Exit
}
if ($id >=400)
{
echo "All over";
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 "File does not exist, go to the next ID";
$id + +;
echo "

content= ' 0; Url=. /test/1.php?id= $id ' > ';
Exit
}//read out the file name, and check that it exists
Else
{
' WinRAR a $filename instructions for use of. txt ';
echo "Insert description file succeeded";
$id + +;
echo " ";
}
Odbc_close ($DB);
?>

http://www.bkjia.com/PHPjc/322647.html www.bkjia.com true http://www.bkjia.com/PHPjc/322647.html techarticle we open the WinRAR Help file, the Help file mentioned in the command line mode to modify the RAR file comments and add a compressed document of the two parameters are a\c,winrar the following: from when ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.