Error While Calling vbs File from Powershell

Welcome Forums General PowerShell Q&A Error While Calling vbs File from Powershell

This topic contains 1 reply, has 1 voice, and was last updated by

 
Participant
3 years, 5 months ago.

  • Author
    Posts
  • #33147

    Participant
    Topics: 1
    Replies: 1
    Points: 0
    Rank: Member

    Hi

    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
    SET VBSARG=%VBSFILELOC%
    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

    Participant
    Topics: 1
    Replies: 1
    Points: 0
    Rank: Member

    Issue is due the CMD file.

The topic ‘Error While Calling vbs File from Powershell’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort