Solved

open app / run bat file from asp

Posted on 2006-07-13
10
1,418 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

786 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