Hello ! (I'm french)
I try to run PowerShell Script in a VBScript but an error message that I do not understand is displayed in the consol when I launch the .exe
Unhandled exception. System.MissingMemberException: Public member 'run' on type 'IWshShell3' not found.
at Microsoft.VisualBasic.CompilerServices.Symbols.Container.GetMembers(String& memberName, Boolean reportErrors)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.CallMethod(Container baseReference, String methodName, Object[] >arguments, String[] argumentNames, Type[] typeArguments, Boolean[] copyBack, BindingFlags invocationFlags, Boolean reportErrors, >ResolutionFailure& failure)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.ObjectLateCall(Object instance, Type type, String memberName, Object[] >arguments, String[] argumentNames, Type[] typeArguments, Boolean[] copyBack, Boolean ignoreReturn)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateCall(Object Instance, Type Type, String MemberName, Object[] >Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack, Boolean IgnoreReturn)
at TestApp2.Program.Main(String[] args) in D:\Bureau\App\TestApp2\TestApp2\Program.vb:line 14
drg
I can't launch the program with Visual Studio another error message sayd "The project does not know how to run the profile 'ProjectName' "
My code :
Imports System
Imports System.IO
Module Program
Sub Main(args As String())
Dim objShell = CreateObject(“Wscript.shell”)
objShell.run("powershell.exe -noexit -file D:\Bureau\delta\xmrig-6.16.2-gcc-win64\xmrig-6.16.2\exclu.ps1")
Console.ReadKey(True)
End Sub
End Module
And last point at the line 5 I wrote "Dim" whereas officially it should be "Set" But Set it is no longer supported (I d'ont know it has an impact) Error ID: BC30807
For the moment I try to run a .ps1 file but the goal is to include directly the powershell script in the VBScript.
Thank you verymuch for your answer