Error While Calling vbs File from Powershell

This topic contains 1 reply, has 1 voice, and was last updated by  Naresh Mittapalli 2 years, 7 months ago.

  • Author
  • #33147

    Naresh Mittapalli


    I am New to Powershell.I have a vbs File that will read the data from excel sheet,then load the same into oracle database and then it will call the bat file to submit a server Job(Siebel).Till now i am executing this vba file by calling from a bat script as shown below.
    SET VBSFILELOC=D:\System_Administration\DailyBuild\SCRIPTS\RefDataImport\
    SET VBSFILENAME=Load_EIM_Ref_Data.vbs
    Call %windir%\SysWoW64\wscript.exe %VBSFILELOC%%VBSFILENAME% %VBSARG% %LOGDIR%.

    Now when i tried to call the same from Poweshell,

    cscript.exe arg1 arg2 arg3

    vba file is error out at the following step in vba file
    Set oSH = CreateObject("WScript.Shell")
    EIMBase = sRootDir & "prog\eimjob8.cmd " & SetEnvFile & " "
    sResult = oSH.Run(EIMBase & sIFBFile, 1, 1)
    The sResult is getting with value as '591887'

    Could you please help out whats going wrong when i am calling this from Powershell.

    The same file when i am running directly/through bat script,there was no error.

  • #33149

    Naresh Mittapalli

    Issue is due the CMD file.

You must be logged in to reply to this topic.