Solved

open app / run bat file from asp

Posted on 2006-07-13
10
1,414 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
IT, Stop Being Called Into Every Meeting

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 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
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/…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

16 Experts available now in Live!

Get 1:1 Help Now