Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    5

    Unanswered: Issue Command Line Instructions

    Can anyone tell me how to issue command line instructions via ASP?

    I am running a dynamic site using MySQL and ASP and wish to back up my MySQL DB on a daily or weekly basis to a remote server/MySQL DB. I know how to do this from the command line using MySQL:

    mysqldump -u username -p password --databases myDatabase | mysql -u username -p password -h remote.server.com

    But i need to be able to issue this command from within an ASP page.
    PHP has various methods for executing command line queries such as exec() & shell_exec() but I don't know any using ASP.

    Thanks in advance,

    Chris

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Code:
    Dim objShell
    Dim cmdString
    
    cmdString = "mysqldump -u username -p password --databases myDatabase | mysql -u username -p password -h remote.server.com"
    
    Set objShell = Server.CreateObject("WScript.Shell")
    objShell.Exec(cmdString)
    Set objShell = Nothing
    That which does not kill me postpones the inevitable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •