Results 1 to 7 of 7

Thread: (urgent) how to Execute Backup on Remote Server thru code?

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2000
    Posts
    57

    (urgent) how to Execute Backup on Remote Server thru code?

    hi,

    i have one problem. my job on hand right now is to take backup of a remote database then zip it then copy it to some other machine then unzip it there and then restore the backup on that machine.

    i have done this successfully(partly) with VB6. i am saying partly because when i shell out to winzip the zipping process starts on the machine which is running the program and not on the server so the whole program takes a lot of time to complete.

    what i want to do is a way to somehow let the backup,zip and copy parts run on the remote machine itself then the other machine will do the unzipping and restore of the zip file sent by the remote server.

    i was thinking of using .NET Remoting or Web Services for this. but dont know how exactly i can do that.

    can anyone please help me in this , its really urgent for me.

    thanks in advance

    pratik

  2. #2
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770
    xstandard (http://www.xstandard.com) have some nice, free ActiveX components that do Zip, gzip, and tar...

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2000
    Posts
    57
    first of all thanks for the reply nkad, but i am not looking for any controls to zip , i am looking for a way to execute my program in two different processes in on remote machine and one on local machine how do i start i a new process from my local machine on the remote machine.

    thanks

    pratik

  4. #4
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770
    Oh, well you can do a ShellExecute, and I think you can do it accrost network shares... 1 second and will post code.

  5. #5
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770
    Code:
        Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    
        Public Const SW_SHOW = 5
        Dim x As Long
    
        x = ShellExecute(Form1.hwnd, "open", strFilename, 0&, strPathToFileName & "\", SW_SHOW)
        
        If x <= 32 Then
            MsgBox "The file '" & strFilename & "' Could not be executed.", vbCritical
        End If
    Hope this helps?

  6. #6

    Thread Starter
    Member
    Join Date
    Feb 2000
    Posts
    57
    thanks nkad once again, but can u please explain me the code. i am seeing shellexecute for the first time.

    i think this code can start winzip on the remote machine if yes what do i have to start

    please explain

    thanks

    pratik

  7. #7
    Fanatic Member
    Join Date
    Sep 2000
    Posts
    770
    basically, to use it. All you do is put the filename of the file you want to execute in the strFileName variable and the full path to the directory of the exectuable on the local or remote system in the strPathToFileName variable (or whatever you decide to call it)

    The line calling the API might look something like this:
    Code:
    x = ShellExecute(Form1.hwnd, "open", "somefile.exe", 0&, "c:\program files\someprogramdir\", SW_SHOW)
    Does this clairfy?

Posting Permissions

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



Click Here to Expand Forum to Full Width