Skip to Content

3 Comments

You must be Logged on to comment or reply to a post.

  1. BasisOne Accenture

    Hi Stefan,

    I am getting following error when I run the automated login script. I have placed the COM.ps1 in same directory as SAP_Auto_login.ps1 script. Please help as I am new to Powershell scripting.

     

    C:\windows\system32> C:\Basis\PowerShell Scripting\SAP_Auto_Login.ps1
    . : The term ‘COM.ps1’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
    spelling of the name, or if a path was included, verify that the path is correct and try again.
    At C:\Basis\PowerShell Scripting\SAP_Auto_Login.ps1:4 char:6
    + .”COM.ps1″
    + ~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (COM.ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    (0) 
  2. BasisOne Accenture

    Hello,

    I am getting following error when trying to run the above Powershell script for automated login. The COM.ps1 file is in same directory.

     

    S C:\windows\system32> C:\Basis\PowerShell Scripting\SAP_Auto_Login.ps1
    . : The term ‘COM.ps1’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
    spelling of the name, or if a path was included, verify that the path is correct and try again.
    At C:\Basis\PowerShell Scripting\SAP_Auto_Login.ps1:4 char:6
    + .”COM.ps1″
    + ~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (COM.ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

     

    Thanks,

    Dnyandev

    (0) 
  3. Stefan Schnell Post author

    Hello,

    try this to solve your problem:

    #-Begin-----------------------------------------------------------------
    
      #-Includes------------------------------------------------------------
        ."$PSScriptRoot\COM.ps1"
    
      $hWSH = Create-Object "Wscript.Shell"
    
      $hWSH.Popup("testmessage", 2, "goto", 1)
      
      Free-Object $hWSH
        
    #-End-------------------------------------------------------------------

    On this way it is possible to run the script from every path.

    Cheers
    Stefan

    (0) 

Leave a Reply