Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Restarting remote SQL server using classic asp

Results 1 to 2 of 2
Share This Thread →
  1. #1
    contactrajkumar is offline Registered User
    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
    gk53's Avatar
    gk53 is offline Contributing User
    Join Date
    Mar 2005
    Location
    Columbus, OH
    Posts
    1,535
    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

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

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

ASP Free Advertisers and Affiliates