Solved

open app / run bat file from asp

Posted on 2006-07-13
10
1,416 Views
Last Modified: 2008-01-09
okay,

have searched a few thousand threads trying to figure out the permissions denied error I am getting. obviously I am doing something wrong here. Anyway, my pc is set up as a web server, and I am just trying to open a file from an asp page. I am using xp OS. My latest attempt has been:

    Dim wshell, intReturn
    set wshell = server.createobject("wscript.shell")
    intReturn = wshell.run("%comspec% /c dir *.* > c:\test.txt", 0, True)
    Response.Write( intReturn )
    set wshell = nothing
 
C:\test has given the Internet Guest Account full permissions (well everything apart from the full control option, and when I check this off, it makes no difference)

Am I missing something else here.

Thanks in advance for any assistance.
0
Comment
Question by:telliot79
  • 4
  • 3
  • 3
10 Comments
 
LVL 31

Expert Comment

by:alorentz
ID: 17104561
Yeah, your error is probably on this line:

set wshell = server.createobject("wscript.shell")

Not on this line:
intReturn = wshell.run("%comspec% /c dir *.* > c:\test.txt", 0, True)

What does your error message line tell you?
0
 
LVL 31

Expert Comment

by:alorentz
ID: 17104571
Also, 3 out of 4 of your questions are still open...please close the old ones.
0
 
LVL 25

Expert Comment

by:kevp75
ID: 17105033
i've run into this issue as well.  I ended up finding out that I had to give IUSR access to cmd, which of course is highly unadvisable
0
 

Author Comment

by:telliot79
ID: 17108927
my error messege:

Error Type:
Microsoft VBScript runtime (0x800A0046)
Permission denied
/batTest2.asp, line 4

but I have given full permissions everywhere I can think of.


"I ended up finding out that I had to give IUSR access to cmd, which of course is highly unadvisable"
I don't even know what this means to be honest.

My ultimate goal is to run a batch file of a .exe file to restart services from a web page.

3 out of four of my questions are open because they were unanswered. how do I close them with out allocating the points?
0
 
LVL 31

Expert Comment

by:alorentz
ID: 17108962
>>3 out of four of my questions are open because they were unanswered. how do I close them with out allocating the points?

Post to Communit Support to have them closed:
http://www.experts-exchange.com/Community_Support/
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 25

Expert Comment

by:kevp75
ID: 17109009
cmd is the Command Prompt, if you go to start->run and type in cmd and hit enter, you'll see what I mean.

what services are you looking to restart? (there may be a better method than prompting out to shell)
0
 

Author Comment

by:telliot79
ID: 17109850
i know what the cmd prompt is and how to get it going, I just don't understand how to give IUSR access to cmd.

The service I want to restart is calld "ZOOM Image Server" I am not sure exactly the best way about going about this, but my ultimite goal is to get this restarted from a web page so if I am out of office I can, in theory, hit the web page from my cell phone and restart the services. This is my ultimate goal, so maybe I should make that another post, in the mean time I just want to get over this first problem. I will uip the points if I get a resolution for this whole task however.

Thanks both for your assistance.
0
 
LVL 31

Accepted Solution

by:
alorentz earned 500 total points
ID: 17109939
0
 
LVL 25

Expert Comment

by:kevp75
ID: 17109945
well...you'd have to give access to  the /system32 folder on the page's server which I would highly recommed against.

q4u?  do you have the latest version of wscript installed on the server?
http://www.microsoft.com/downloads/details.aspx?FamilyId=C717D943-7E4B-4622-86EB-95A22B832CAA&displaylang=en

i also wonder if you would have to change this line:
set wshell = server.createobject("wscript.shell")

to:
Set wshell = WScript.CreateObject("WScript.Shell")
0
 

Author Comment

by:telliot79
ID: 17111203
brilliant mate.

thanks.

still haven't quite got it working, i am going to put another post up to convert that vbs to asp as I can't seem to get it going.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 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

21 Experts available now in Live!

Get 1:1 Help Now