473,394 Members | 1,811 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

start calculator in remote machine using WMI

115 100+
from my system i need to open a calculator in remote machine. and i'm using Vb.net and WMI. i need to pop up the calculator in remote machine, while i run one program in my system. while running in rmotre machine's taskmanager the calculator is displaying, but its not popuping.

i tried this code for pop up using Win32_ProcessStartup like this...

Expand|Select|Wrap|Line Numbers
  1. Module Module1
  2. Sub Main()
  3. Dim retValue As String
  4. retValue = RunCommand("calc.exe", "MachineName", "MachineName\UserID", "Password")
  5. Console.WriteLine(retValue)
  6. End Sub
  7.  
  8. Function RunCommand(ByVal strCommand As String, ByVal strMachineName As String, _
  9. ByVal strUserName As String, ByVal strPassword As String) As String
  10. Dim options As New System.Management.ConnectionOptions
  11. options.Username = strUserName
  12. options.Password = strPassword
  13. options.Impersonation = Management.ImpersonationLevel.Impersonate
  14. options.Authentication = Management.AuthenticationLevel.PacketPrivacy
  15.  
  16. Dim path As New System.Management.ManagementPath("\\" & strMachineName & "\root\cimv2:Win32_Process")
  17. Dim scope As New System.Management.ManagementScope(path, options)
  18.  
  19. Dim procStart As ManagementClass = New ManagementClass("Win32_ProcessStartup")
  20. Dim ps As ManagementObject = procStart.CreateInstance
  21. ps("ShowWindow") = 1
  22.  
  23. scope.Connect()
  24.  
  25. Dim opt As New System.Management.ObjectGetOptions
  26. Dim classInstance As New System.Management.ManagementClass(scope, path, opt)
  27.  
  28. Dim inParams As System.Management.ManagementBaseObject = classInstance.GetMethodParameters("Create")
  29. inParams("CommandLine") = strCommand
  30. inParams("ProcessStartupInformation") = ps
  31.  
  32. ' Execute the method and obtain the return values.
  33. Dim outParams As System.Management.ManagementBaseObject = classInstance.InvokeMethod("Create", inParams, Nothing)
  34.  
  35. End Function
  36.  
  37. End Module
  38.  
  39.  
is this the way we need to add Win32_ProcessStartup inside my program.
sorry for disturbing you again. actually i dont have much idea about WMI. i'm new to this. that's why.
if any thing wrong in this codes, please let me know. while running its not creating any errors, but not displaying the calculator in windows. that's why...
if you have any idea please let me know....
thanks in advance and thanks for your help....
May 15 '07 #1
1 5602
remya1000
115 100+
still the calculator is opening inside the taskmanager, not pop up in windows. can you have any idea what's wrong in my codes. if you have please let me know how can i display calculator as pop up window in remote machine.
May 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Vadim Rapp | last post by:
Hello, I have the following code: ========== Dim RemoteService As System.ServiceProcess.ServiceController RemoteService = New System.ServiceProcess.ServiceController("service1",...
1
by: Maximus | last post by:
hi all, I want to kow if there is a way to connet a machine using a VPN client through vb.net or c# code. I have requirement where i need to copy file using VPN. Hence, I need to start the...
0
vinoj
by: vinoj | last post by:
Hi All, These are the following things which i want to do:- 1. I will be taking the ipaddress, username and password from the user using cgi ffrom the browser. 2. Now i want...
1
by: thamayanthi | last post by:
Hi, Please find the below code which is used to Print the Operating System of a remote Machine of linux.This code is working fine,if i give the correct UserName and Password of a machine but what...
2
by: pnalla | last post by:
hi, I can aceess ths windows services on remote machine. but i can not start and stop the services.it gives some error message like " can not open 'service name' on comuter 'machine name'. Please...
2
by: pnalla | last post by:
How to access windows services on remote machine using C#.please give me some example code.also how to start/stop service on remote machine .please give me some example code. thanks prasad
0
by: qwerty27 | last post by:
how to get version of installed component services on remote machine using c#? this is for local machine....but i want fr remote machine COMSVCSLib.MtsGrpClass group = new...
2
by: vimalsantoki | last post by:
Any one please help me in c#. I want to start a GUI process in remote machine using c#.net. I have develop one windows application for LAN in which I provide a facility of remote process start...
1
by: Namitha Bhat | last post by:
Hi ALL, This realates to vb script code to append a file in C Drive in a remote machine accessed from a machine in different domain. I am able to successfully connect to the machine, but the file...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.