If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Issue Command Line Instructions

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-23-04, 05:32
chris_gilbert chris_gilbert is offline
Registered User
 
Join Date: Jun 2004
Posts: 5
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
Reply With Quote
  #2 (permalink)  
Old 06-23-04, 10:47
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On