Solved

arj.exe and wscript.shell

Posted on 2004-04-06
7
3,841 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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This video teaches users how to migrate an existing Wordpress website to a new domain.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now