Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

arj.exe and wscript.shell

Posted on 2004-04-06
7
Medium Priority
?
3,854 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 375 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 375 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 750 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 750 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

Linux Academy Android App Now Supports Chromecast

We have some fantastic news for our Android fans. We’re so excited to announce that the Linux Academy Android app is now available with Chromecast support. That’s right – simply download the latest update of the Linux Academy App and start casting your favorite course videos!

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
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…
Suggested Courses

715 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