Solved

open app / run bat file from asp

Posted on 2006-07-13
10
1,420 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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/…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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