Execute a VBScript

  • What am I doing wrong with this? I have set up a job to execute a VBScript via the cmdexec and I keep getting an error of "The process could not be created for step 1 of job 0x817BF0915ACA844B9454B47F2B579199 (reason: %1 is not a valid Win32 application).  The step failed."

    The command is "E:\SQLTaks\\CopyFile.vbs"


    Kindest Regards,

  • Use some common sense, and post the vbscript if you actually expect any response to this issue.  And, if I sound like I am being a a$$hole, it was intended that way.



    A.J.
    DBA with an attitude

  • Hello,

    When using cmdexec use the following

    cscript myscript.vbs

    or in your case cscript "E:\SQLTaks\\CopyFile.vbs" I am not sure about quotes,we are running without quotes

     

    To awilbur77 

    you do sound like what you are saying, everyone else is trying to respect each other.

     

    Regards,Yelena Varsha

  • Thanks Yelena.

    awilbur77,

    I have been a respected member of these forums on this web site for a long time. No one has ever spoken to me in that tone and these forums are exactly what Yelena has mentioned.

    Just who do think you are talking in that tone?

    So if you do not have anything positive to say don't say anyting at all! Take your miserable attitude to another forum/website that accepts such pathetic tones!


    Kindest Regards,

  • I don't know if this is typo in the post but you have a \\ in the path.

    MG

    "There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies."
    Tony Hoare

    "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair.

  • Thanks MG.

    Thanks for pointing that out.


    Kindest Regards,

  • I am experiencing the same problem with the vbscript.  Did the solution suggested by Yelena Varshal resolve the issue?

  • Data,

    I did resolve the issue for one of our developers and he is using this syntax in his jobs. You may test it from the command line first as opening command prompt window and typing

    cscript C:\myscript.vbs

    where C:\myscript.vbs is a path and a name of your vbscript. If it works from the command line then you may use it in a job with a job step of the type Operating System (CmdExec)I got this advice from somebody else a couple of years ago.

    Let us know if it worked for you

    P.S.

    Adding a reference with all parameter description for cscript command:

    http://www.microsoft.com/windows2000/en/advanced/help/default.asp?url=/windows2000/en/advanced/help/wsh_runfromcommandprompt.htm

    To run scripts using the command-line-based script host (Cscript.exe)

    One of the parameters:

    //H:cscript or //H:wscript

    Registers Cscript.exe or Wscript.exe as the default application for running scripts. If neither is specified, Wscript.exe is assumed as the default.

    wscript is Windows Script Host  Since we are trying to run scripts using command line (CmdExec) than cscript is the more appropriate script host

    Regards,Yelena Varsha

Viewing 8 posts - 1 through 7 (of 7 total)

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