Solved

arj.exe and wscript.shell

Posted on 2004-04-06
7
3,845 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
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

772 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