Solved

arj.exe and wscript.shell

Posted on 2004-04-06
7
3,847 Views
Last Modified: 2007-12-19
I wrote the following asp code

<%
set wshell = server.createobject("wscript.shell")
set proc=wshell.Exec("c:\test\arj.exe a -e c:\test\test.arj c:\test\*.txt")
Do While proc.Status = 0
 Loop
Response.Write("<BR>")
Response.Write("a="&proc.StdOut.ReadAll())
Response.Write("<BR>")
Response.Write("b="&proc.StdErr.ReadAll())
set wshell = nothing
%>

after the file test.arj was created, I deleted all the txt files and I replaced the line in the asp code with
set proc=wshell.Exec("c:\test\arj.exe e -y c:\test\test.arj")

but the txt files are not created and I don't know why. Please help !


0
Comment
Question by:s_acsinte
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 1

Assisted Solution

by:Cyrrus30
Cyrrus30 earned 125 total points
ID: 10766661
Are you sure that test.arj is there?
If you type it in ms-dos prompt, will it work?
Try using "arj.exe x" instead of "arj.exe e"
I don't remember what is the difference between them.. it was a long time ago! I didn't knew that somone was still using arj nowadays...:)
0
 
LVL 19

Assisted Solution

by:webwoman
webwoman earned 125 total points
ID: 10771487
Everything needs to be on the server. Also, the IUSR_machine account ON THE SERVER needs to have execute access, and possibly other permissions as well.
0
 

Author Comment

by:s_acsinte
ID: 10772188
everything is on the server.
both IUSR_machine and IWAM_machine  have full control on c:\temp
(remember test.arj was created with the first asp)

I've tried using x, but nothing.
(the command works when used at DOS prompt)
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Accepted Solution

by:
TheKenman earned 250 total points
ID: 10782405
Hi s_acsinte,

I think you need to do this:

   <%
   set wshell = server.createobject("wscript.shell")
   set proc = wshell.Exec("c:\test\arj.exe a -e c:\test\test.arj c:\test\*.txt")
   dim s : s = ""
   Do While proc.Status = 0
      s = s & "<BR>a=" & proc.StdOut.ReadAll()
      s = s & "<BR>b=" & proc.StdErr.ReadAll()
   Loop
   response.write(s)
   set proc = nothing
   set wshell = nothing
   %>

You had your 'loop' statement in the wrong location.

I also changed the way the output is written; it shouldn't affect the output except to make it more efficient (faster). You also forgot to set proc = nothing (which is inefficient).
0
 
LVL 7

Assisted Solution

by:TheKenman
TheKenman earned 250 total points
ID: 10782434
If that's not the cure, then try this:

   <%
   set wshell = server.createobject("wscript.shell")
   set proc=wshell.Exec("c:\test\arj.exe a -e c:\test\test.arj c:\test\*.txt")
   'let the action finish before attempting to do anything with it
   do while proc.status = 0
      wscript.sleep 100 'or 250, 500, try several values
   loop
   dim s : s = ""
   s = s & "<BR>a=" & proc.StdOut.ReadAll()
   s = s & "<BR>b=" & proc.StdErr.ReadAll()
   response.write(s)
   set wshell = nothing
   %>
0
 

Author Comment

by:s_acsinte
ID: 10811239
sorry TheKenman, bur as I said my "arj.exe a" works fine, the test.arj file is created.
it's "arj.exe e" that doesn't work.
I even tried your suggestion (with e instead of a) and the files are not extracted.


0
 
LVL 7

Expert Comment

by:TheKenman
ID: 10834377
Well did you figure it out?

Thanks =)
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
youtube blocking politics 4 82
xss alert in domino url 9 57
MediaWiki - Move a site 4 33
Getting robots.txt Error 9 24
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question