#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2013
    Posts
    2
    Rep Power
    0

    Restarting remote SQL server using classic asp


    Hi Friends,
    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")
    wshell.run "\\ServerName\SharedFolder\sql.bat"
    set wshell = nothing

    this is not working. Can anyone guide me how to achive this.
    Thanks in Advance,
    Regards,
    Rajkumar M.
  2. #2
  3. Contributing User
    ASP Skiller (1500 - 1999 posts)

    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,585
    Rep Power
    278
    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
    GK
    __________________________________________________ _____
    if you found this post is useful click Give Rep button (bottom side on this reply ) and agree

Similar Threads

  1. Replies: 5
    Last Post: December 10th, 2009, 05:29 PM
  2. Replies: 0
    Last Post: January 30th, 2007, 03:01 AM
  3. Putting data from Local Server to remote server
    By vikasbhandari in forum ASP Development
    Replies: 8
    Last Post: January 16th, 2006, 10:56 AM
  4. Replies: 0
    Last Post: November 30th, 2003, 02:12 AM
  5. How to connect web server to a remote sql server.
    By Steve Schofield in forum SQL Development
    Replies: 1
    Last Post: July 16th, 2001, 08:30 PM

IMN logo majestic logo threadwatch logo seochat tools logo