Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run a batch file from ASP

Status
Not open for further replies.

TheCandyman

Technical User
Sep 9, 2002
761
US
I'm trying to do a simple back file which does IISreset command. I set the ISR_ permissions to full and I still get this permissions error. I'm not sure what else i need to change permissions on???


Error
Code:
Microsoft VBScript runtime  error '800a0046'
Permission denied
/testRestart.asp, line 3


file.bat
Code:
@echo off
iisreset /stop /noforce
iisreset /start


ASP
Code:
<% 
    set wshell = CreateObject("WScript.Shell") 
    wshell.run "c:\file.bat" 
    set wshell = nothing 
%>
 
What is the purpose of that process? It doesn't make any sense at all. Why would you use ASP to reset IIS

[sub]____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done[/sub]
 
It releases the processes used in IIS, in testing if i hit an endless loop it's a way to fix it. But enough on that.

I know it's possible because i see a few posts, just no permissions issues. I also moved the file into the website thinking it might be an issue going outside the website directory. Any ideas??
 
I can't help but let you know that is horrid. Actually worse than that.

To release the process? Infinite loops? Is your environment that bad that you need to programmatically take care of bad programming?

Really, first off you are using a technology to stop the one thing that is being used to run that technology. Second you're putting a bandage on something that should be fixed aside from just a work around. And I say bandage because this open wound is far to big to be covered by a band-aid. Last you are giving IUSR_machine the rights to your C drive. Wow, hope that IIS server is behind some good firewalls.

I have plenty of ideas and ways to make it work but I refuse to help with something that should not be done in our business and what was viewed upon as some of the most intelligent members of IT making it up. I hope you take this as the best tip you've ever received because it very well probably is. Fix the problems! Don't hide them with more problems.

[sub]____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done[/sub]
 
I complete agree with the "fix the problems" It's only a test machine internally but many programmers use it, NO WAY on a live machine that users would see. This being said, it's more of a lazy way to quickly fix the issue and continue programing to fix the bugs.
 
Do you have any idea what a person can do to your environment with full control of the cmd.exe? Even some unknowing power user on your network that read a really cool article over the weekend on how to hack web sites?

[sub]____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top