• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 371
  • Last Modified:

How do I execute a program on a remote computer?

How do I execute a program on a remote computer?
1 Solution
What os is the remote computer using

you can use telnet , terminal server , dameware
or any remote control software

also you can install services from remote location
using srvinstw.exe from w2k resource kit
If you give us some more information on what you really want to do, then we can give you some ideas... It really depends on the situation, but I have found ways for running most things remotely. But as I said, it depends on what you're trying to do.
logindaniAuthor Commented:
Basically I'm trying to insert a REG file into the registry using "regedit /s <Filename>"

But I would like to be able to run any application like notepad.exe for example.

I saw it is simple to do with WMI, but I can't rely on it being installed on the remote machine.
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

With regedt32 you can access the registry of a remote Windows NT/2000/XP computer. You can do this via Registry |Select Computer |\\name001
You need to have sufficient rights to do this.

With rcmd from the Windows 2000 resouce kit you can execute remote commands.

Hope this helps.

hendrik999 has exactly what you need for that scenario. You can use WMI or other ways, but if that's all you need then those two should accomplish the taks you mentioned.
logindaniAuthor Commented:
Guys, guys ... I need to do it from WITHIN THE CODE ...,
and I need it to work for NT, 2000 and XP.

Since I don't have WMI on NT, I need one of the 'other ways' you mentioned.
Ahhh, that's what I was talking about. We need to know exactly what you need to do. We did not know that you wanted code to run a remote application. The suggestion that hendrik999 offered met every requirement that you made here.

Now, what do you mean "from WITHIN THE CODE"?

What code are you speaking of? Do you wish to create a VB app or such that you can run on your computer that will execute applications on a remote computer and you want code that you can run to accomplish this?

One of the OTHER WAYS I mentioned would be in fact to use shell scripting to run a remote app such as hedrick999 mentioned. To remotely administer the registry, there are other shell scripting commands you can use to accomplish that using the Windows 2000 Resource Kit Tools. We need to know your requirements a bit better...
logindaniAuthor Commented:
I'm building a VB app that is responsible for configuring servers. I'm mostly configuring the registry but I also need to run exexutables on those servers. I have to support servers that run on NT and 2000.
Hi logindani,
ok, my comment is not for including in your code, but it's a separate file but it works very fine.
Here http://www.sysinternals.com/ntw2k/freeware/psexec.shtml you can find a very good working remote execute tool. This tool works also with download the exe-file if it doesnt exist on the remote site.
Hope it helps a bit
Well then Hendrik999's idea will work fine then. Using VB code, there is a shell command (I can't remember it off the top of my head.. I haven't programmed in a while) to run shell cripts such as batch files, executables, or others with parameters. Get the Resource kit tools or the application mentioned by gro and call the executables with parameters.
Dear questionner/expert(s)

No comment has been added lately, so it's time to clean up this TA.
I'll leave a recommendation in the Cleanup topic area that this question is to be:

- PAQ'd and pts removed

Please leave any comments here within the next seven days.



Cleanup volunteer
Per recommendation, points NOT refunded and question closed.

EE Admin
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now