Run VB exe file via xp_cmdShell

  • hi everyone

    I tried to run a VB6 exe program in server using sql 2000 agent job. It ran the program

    but never stop it. so, the program still running in the server. when tried to did the end process, error fires "Access denied" file in use.

    Any solution to this please?

    How i could run an exe program using sql agent?

    Next:

    I tried to run the exe program using the server task scheduler, it fires an error:

    “Application defined or object defined error”.

    Any solution please?

  • No reason you can't do this, I do it all the time. Things to watch out for is any type of modal dialog/prompt for user input. App runs with no UI access, so if it happens, the job will hang. Also make sure that the agent has sufficient permissions to do whatever task the exe is doing (db access, file permission, etc).

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Thanks Andy,

    my exe application runs itself and killed itself. i test on my local machine and it does the job. what this exe do:

    create report using data report object and print on printer and killed itself. I don't need user input, its all automatic process.

  • Also, make sure there are no MsgBox statements. The VB app should be developed purely as a console app. It should issue no messages or requests requiring interaction from a user.

    One app we had used MsgBox to display error messages. Therefore each time the app had an error, from the client side it seemed to just hang. When we opened a remote desktop session, there was the message box on the server waiting for someone to click 'OK'.

    Hope this helps

    Phill Carter

    --------------------

    Colt 45 - the original point and click interface

    --------------------
    Colt 45 - the original point and click interface

  • hi i tried, this.

    i'm trying to start the winvnc.exe installed on one server in a sql job packaged inside another vb exe file. The job started the exe file but it uses only half of the memory it's supposed to use and sessions could not be established. The job executed succesfully but still can't logon to vnc. but if i execute the exe file directly, then it can launch the winvnc.

    any thoughts on this?

Viewing 5 posts - 1 through 4 (of 4 total)

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