vbscript to execute sql call

  • I need to have the following command executed in a script via GPO and it has been hinted this will best be accomplished in a vbscript:

    start \\server\share\application.exe Provider=sqloledb;Data Source=sqlserver1;Initial Catalog=database1;User Id=Standard_User;Password=password1;

    where the program application.exe is to run with the details of an sql instance database1 passed as parameters.

    I will be grateful for any help with vbscripting this.

    Thanks.

    Robert

  • Try something like this:

    Dim shellObject

    Set shellObject = CreateObject("WScript.Shell")

    Dim execObject

    Set execObject = shellObject.Exec(" ")

    While (execObject.Status = 0)

    WScript.Sleep(100)

    WEnd

    WScript.Shell also has Run method, which waits for spawned process to finish execution. The full description of using WScript.Shell object can be found in MSDN in the discussion of Microsoft Script Technologies.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply