Click here to Skip to main content
15,920,110 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionExecute EXE Pin
nitin_ion5-Jul-06 1:06
nitin_ion5-Jul-06 1:06 
AnswerRe: Execute EXE Pin
Dave Kreskowiak5-Jul-06 1:30
mveDave Kreskowiak5-Jul-06 1:30 
GeneralRe: Execute EXE Pin
nitin_ion5-Jul-06 18:54
nitin_ion5-Jul-06 18:54 
GeneralRe: Execute EXE Pin
Dave Kreskowiak6-Jul-06 2:22
mveDave Kreskowiak6-Jul-06 2:22 
GeneralRe: Execute EXE Pin
nitin_ion6-Jul-06 2:24
nitin_ion6-Jul-06 2:24 
GeneralRe: Execute EXE Pin
Dave Kreskowiak6-Jul-06 2:34
mveDave Kreskowiak6-Jul-06 2:34 
GeneralRe: Execute EXE Pin
nitin_ion6-Jul-06 17:23
nitin_ion6-Jul-06 17:23 
GeneralRe: Execute EXE Pin
Dave Kreskowiak7-Jul-06 2:01
mveDave Kreskowiak7-Jul-06 2:01 
When you created the Win32_Process class, you didn't give the ManagementClass the scope you wanted to create the class in, so the default scope is used -> the local machine.
Dim co As New ConnectionOptions
With co
    .Impersonation = System.Management.ImpersonationLevel.Impersonate
    .Authentication = System.Management.AuthenticationLevel.Packet
    .Username = "Admin level account on target machine"
    .Password = "password"
End With

Dim scope As ManagementScope
Dim machine As String = "targetMachineName"
scope = New ManagementScope("\\" & machine& "\root\cimv2", co)
scope.Connect()
If scope.IsConnected = False Then
    MsgBox("Could not connect to WMI namespace")
End If

Dim proc As New ManagementClass(scope, New ManagementPath("Win32_Process"), Nothing)
Dim inParams As ManagementBaseObject = proc.GetMethodParameters("Create")
inParams("CommandLine") = "calc.exe"
Dim outParams As ManagementBaseObject = proc.InvokeMethod("Create", inParams, Nothing)
Debug.WriteLine("Win32_Process:Create returned: " & outParams("returnValue").ToString())



Dave Kreskowiak
Microsoft MVP - Visual Basic

QuestionControlling other windows from VB.NET application Pin
seamie5-Jul-06 1:03
seamie5-Jul-06 1:03 
AnswerRe: Controlling other windows from VB.NET application Pin
Dave Kreskowiak5-Jul-06 1:34
mveDave Kreskowiak5-Jul-06 1:34 
GeneralRe: Controlling other windows from VB.NET application Pin
seamie5-Jul-06 2:53
seamie5-Jul-06 2:53 
QuestionRe: Controlling other windows from VB.NET application Pin
mr_lasseter5-Jul-06 7:33
mr_lasseter5-Jul-06 7:33 
AnswerRe: Controlling other windows from VB.NET application Pin
Dave Kreskowiak5-Jul-06 8:18
mveDave Kreskowiak5-Jul-06 8:18 
Questiondiffrence between vb exe file and other Pin
zon_cpp5-Jul-06 0:46
zon_cpp5-Jul-06 0:46 
AnswerRe: diffrence between vb exe file and other Pin
Dave Kreskowiak5-Jul-06 1:36
mveDave Kreskowiak5-Jul-06 1:36 
GeneralRe: diffrence between vb exe file and other Pin
zon_cpp5-Jul-06 2:08
zon_cpp5-Jul-06 2:08 
GeneralRe: diffrence between vb exe file and other Pin
Dave Kreskowiak5-Jul-06 2:56
mveDave Kreskowiak5-Jul-06 2:56 
Questionhow to deal with point data? Pin
codeadair4-Jul-06 22:18
codeadair4-Jul-06 22:18 
AnswerRe: how to deal with point data? Pin
Dave Kreskowiak5-Jul-06 1:39
mveDave Kreskowiak5-Jul-06 1:39 
AnswerRe: how to deal with point data? Pin
Jun Du5-Jul-06 4:42
Jun Du5-Jul-06 4:42 
QuestionRunning Pin
Socheat.Net4-Jul-06 21:13
Socheat.Net4-Jul-06 21:13 
AnswerRe: Running Pin
Mekong River4-Jul-06 21:24
Mekong River4-Jul-06 21:24 
GeneralRe: Running Pin
Socheat.Net4-Jul-06 21:40
Socheat.Net4-Jul-06 21:40 
GeneralRe: Running Pin
Guffa4-Jul-06 21:58
Guffa4-Jul-06 21:58 
GeneralRe: Running [modified] Pin
Socheat.Net4-Jul-06 22:33
Socheat.Net4-Jul-06 22:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.