Powershell Script

Discuss RoboTask here
Post Reply
gremlin
Posts: 37
Joined: Sun Jan 08, 2023 3:13 pm

Powershell Script

Post by gremlin »

Hy,
when I try to Print a HTMl File with the Powershell Script Module,

Code: Select all

$ie = new-object -com "InternetExplorer.Application"
$ie.Navigate("c:\JTL-TMP\UEBERGABESCHEIN-DHL.html")
Start-Sleep -Seconds 3
$ie.ExecWB(6,2)
Start-Sleep -Seconds 3
$ie.quit()
I got a error!?

Code: Select all

-: 22.05.2024 16:55:10: [STDOUT] Der RPC-Server ist nicht verfgbar. (Ausnahme von HRESULT: 0x800706BA)
-: 22.05.2024 16:55:10: [STDOUT] In C:\Users\StrandkorbKing\AppData\Local\Temp\VjsPcwVDSICI7x7WL45zv3TrZJqYwC8K.ps1:4 Zeichen:1
-: 22.05.2024 16:55:10: [STDOUT] + $ie.ExecWB(6,2)
-: 22.05.2024 16:55:10: [STDOUT] + ~~~~~~~~~~~~~~~
-: 22.05.2024 16:55:10: [STDOUT] + CategoryInfo          : OperationStopped: (:) [], COMException
-: 22.05.2024 16:55:10: [STDOUT] + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
-: 22.05.2024 16:55:10: [STDOUT] 
-: 22.05.2024 16:55:13: [STDOUT] Der RPC-Server ist nicht verfgbar. (Ausnahme von HRESULT: 0x800706BA)
-: 22.05.2024 16:55:13: [STDOUT] In C:\Users\StrandkorbKing\AppData\Local\Temp\VjsPcwVDSICI7x7WL45zv3TrZJqYwC8K.ps1:6 Zeichen:1
-: 22.05.2024 16:55:13: [STDOUT] + $ie.quit()
-: 22.05.2024 16:55:13: [STDOUT] + ~~~~~~~~~~
-: 22.05.2024 16:55:13: [STDOUT] + CategoryInfo          : OperationStopped: (:) [], COMException
-: 22.05.2024 16:55:13: [STDOUT] + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
-: 22.05.2024 16:55:13: [STDOUT] 
When I call the lines separtly at powershell, everything works fine.

Can you help me please
Oleg
Site Admin
Posts: 3051
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Powershell Script

Post by Oleg »

When I call the lines separtly at powershell, everything works fine.
Hm-m...
I got the the same error on line #4 ($ie.ExecWB(6,2)) and #6 ($ie.quit()) in separate powershell. Of course I use my HTML file

Code: Select all

PS D:\vhd> $ie = new-object -com "InternetExplorer.Application"
>> $ie.Navigate("D:\Temp\check_for_updates.htm")
>> Start-Sleep -Seconds 3
>> $ie.ExecWB(6,2)
>> Start-Sleep -Seconds 3
>> $ie.quit()
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At line:4 char:1
+ $ie.ExecWB(6,2)
+ ~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException

The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At line:6 char:1
+ $ie.quit()
+ ~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (:) [], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException
Oleg Yershov
Post Reply