January 17th, 2013, 12:07 AM
Restarting remote SQL server using classic asp
I need to restart SQL server service using my classic asp website, for that I have created batch file on the windows server which got installed sql server.
Command in batch file :
NET STOP SQLSERVERAGENT
NET STOP MSSQLSERVER
NET START MSSQLSERVER
NET START SQLSERVERAGENT
If I run the batch file manually by using remote desttop, its working fine. I'm calling this in asp page using ,
set wshell = CreateObject("WScript.Shell")
set wshell = nothing
this is not working. Can anyone guide me how to achive this.
Thanks in Advance,
January 17th, 2013, 07:20 AM
it is looks like permissions problem. when you run batch from command line system used permissions of your windows account, when you run from asp it is from internet user account which does not have permissions to stop and start services
if you found this post is useful click Give Rep button (bottom side on this reply ) and agree