S sysirm Unregistered / Unconfirmed GUEST, unregistred user! 2004-04-14 #1 如题<br>比如<br>E:/doc目录下的DOC1.TXT <br>要压缩为E:/c-51目录下的text.rar<br>释放相反<br>压缩的时候能不能不出现Winrar的运行界面呢<br>谢了
H Highpeak Unregistered / Unconfirmed GUEST, unregistred user! 2004-04-14 #2 可以不出现winrar界面,把最后一个参数设置未SW_HIDE就可以了。<br>
H Highpeak Unregistered / Unconfirmed GUEST, unregistred user! 2004-04-14 #3 ShellExecute(0,'open','C:/Program Files/WinRAR/rar.exe','a E:/c-51/doc1.rar e:/doc/doc1.txt',nil,sw_hide);
ShellExecute(0,'open','C:/Program Files/WinRAR/rar.exe','a E:/c-51/doc1.rar e:/doc/doc1.txt',nil,sw_hide);
S sysirm Unregistered / Unconfirmed GUEST, unregistred user! 2004-04-14 #4 哦,我在DOS下运行如下命令参数<br>winrar.exe a -r e:/doc/text.rar e:/doc/Doc1.txt<br>可以成功将e:/doc/Doc1.txt压缩到e:/doc/text.rar<br>但为什么在DELPHI下<br>ShellExecute<br>(0,"open","winrar","A -r e:/doc/text.rar e:/doc/Doc1.txt",NULL,SW_HIDE);<br>却做不到呢?
哦,我在DOS下运行如下命令参数<br>winrar.exe a -r e:/doc/text.rar e:/doc/Doc1.txt<br>可以成功将e:/doc/Doc1.txt压缩到e:/doc/text.rar<br>但为什么在DELPHI下<br>ShellExecute<br>(0,"open","winrar","A -r e:/doc/text.rar e:/doc/Doc1.txt",NULL,SW_HIDE);<br>却做不到呢?
S sysirm Unregistered / Unconfirmed GUEST, unregistred user! 2004-04-14 #5 不好意思,刚打的是C++Builder下的代码,不过Delphi下还是一样的,双引号应改成单引号,
C chengangsir Unregistered / Unconfirmed GUEST, unregistred user! 2004-04-14 #6 压缩<br>winexec(pchar('C:/Program Files/WinRAR/WinRAR.exe A d:/aa d:/aa.txt'),SW_HIDE);<br>解压<br>winexec(pchar('C:/Program Files/WinRAR/WinRAR.exe e d:/aa.rar d:/'),SW_HIDE);
压缩<br>winexec(pchar('C:/Program Files/WinRAR/WinRAR.exe A d:/aa d:/aa.txt'),SW_HIDE);<br>解压<br>winexec(pchar('C:/Program Files/WinRAR/WinRAR.exe e d:/aa.rar d:/'),SW_HIDE);
H Highpeak Unregistered / Unconfirmed GUEST, unregistred user! 2004-04-14 #7 第三个参数不对,应该这样:<br>'C:/Program Files/WinRAR/rar.exe'
S sysirm Unregistered / Unconfirmed GUEST, unregistred user! 2004-04-14 #8 Highpeak你的代码在DELPHI通过了<br>但<br>ShellExecute(0,"open","C:/Program Files/WinRAR/rar.exe","a E:/c-51/doc1.rar e:/doc/doc1.doc",NULL,SW_HIDE);<br>在C++Builder为什么还是不行呢<br>
Highpeak你的代码在DELPHI通过了<br>但<br>ShellExecute(0,"open","C:/Program Files/WinRAR/rar.exe","a E:/c-51/doc1.rar e:/doc/doc1.doc",NULL,SW_HIDE);<br>在C++Builder为什么还是不行呢<br>
S sysirm Unregistered / Unconfirmed GUEST, unregistred user! 2004-04-14 #12 ShellExecute(NULL,"open","C://Program Files//WinRAR//rar.exe","a -r E://c-51//doc1.rar e://doc//doc1.doc",NULL,SW_HIDE);<br>搞定,谢了<br>还有一个问题想问一下,我用<br>ShellExecute(NULL,"open","C://Program Files//WinRAR//rar.exe","x E://c-51//doc1.rar e://c-51//",NULL,SW_HIDE);<br>进行解压后,会出现一个doc文件夹,然后doc1.doc文件在它目录下<br>怎么样可以直接把doc1.doc解压出来,而没有这个doc文件夹生成呢?<br>
ShellExecute(NULL,"open","C://Program Files//WinRAR//rar.exe","a -r E://c-51//doc1.rar e://doc//doc1.doc",NULL,SW_HIDE);<br>搞定,谢了<br>还有一个问题想问一下,我用<br>ShellExecute(NULL,"open","C://Program Files//WinRAR//rar.exe","x E://c-51//doc1.rar e://c-51//",NULL,SW_HIDE);<br>进行解压后,会出现一个doc文件夹,然后doc1.doc文件在它目录下<br>怎么样可以直接把doc1.doc解压出来,而没有这个doc文件夹生成呢?<br>
S sysirm Unregistered / Unconfirmed GUEST, unregistred user! 2004-04-14 #13 好啦<br>换用chengangsir说的那个“e"参数搞定啦<br>ShellExecute(NULL,"open","C://Program Files//WinRAR//rar.exe","e -r E://c-51//doc1.rar e://c-51//",NULL,SW_HIDE);<br><br>
好啦<br>换用chengangsir说的那个“e"参数搞定啦<br>ShellExecute(NULL,"open","C://Program Files//WinRAR//rar.exe","e -r E://c-51//doc1.rar e://c-51//",NULL,SW_HIDE);<br><br>