Solved

arj.exe and wscript.shell

Posted on 2004-04-06
7
3,852 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

627 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