Batch - script calling script

This topic contains 1 reply, has 1 voice, and was last updated by Profile photo of Gelson Alves Gelson Alves 2 years, 3 months ago.

  • Author
    Posts
  • #18754
    Profile photo of Gelson Alves
    Gelson Alves
    Participant

    I have a puzzling problem:

    I have a script that when I click in a button, it runs another .ps1 script. In Powershell ISE it works perfectly, but when I start from a Batch Script it not work, not start the second script.
    The event:

    Register-ObjectEvent $call_x1 Click click_event -Action {
    Invoke-Expression "E:\Tests\x1.ps1"

    I use forms.

  • #18755
    Profile photo of Gelson Alves
    Gelson Alves
    Participant

    In Powershell ise works. But when I run through the batch does not work.
    Test the following situation:

    batch file starts "script1.ps1"

    script1.ps1 start an event that calls script2.ps1.

    the script2.ps1 not run.

    But if we start the script1.ps1 through Powershell ISE, the event that calls script2.ps1 works perfectly.

You must be logged in to reply to this topic.