Page 1 of 1 1
Topic Options
#144305 - 2005-07-26 05:37 PM Running kxrpc or execute application on remote system
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
I seem to not be able to understand just how to fire off an application off of a remote server.
I install the kxrpc.exe on the server and tried everything else, but nothing.

Any direction would be great!!!
_________________________
www.microcyb.com

Top
#144306 - 2005-07-26 05:49 PM Re: Running kxrpc or execute application on remote system
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What does KXRPC have to do with it?
What application are you trying to fire off and how?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#144307 - 2005-07-26 06:10 PM Re: Running kxrpc or execute application on remote system
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
In short I am trying to fire off a commend to a remote server to restart a service.
Just trying to do a remote execution like for exmaple:
server: \\mp2k3dw\
application: notepad.exe

execute the notepad.exe on the mpwk3dw

not sure how to do it and thought that kxrpc was the tool to install and use.
_________________________
www.microcyb.com

Top
#144308 - 2005-07-26 06:45 PM Re: Running kxrpc or execute application on remote system
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
XNET can be used for remote services but Notepad.exe is not a service.

There are WMI examples posted that will launch notepad.ese but unless you use the same creds as the logged on user, it will not interact with the desktop. You can also use scheduled tasks.

If security is of no concern, you can also use PSExec from SysInternals.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#144309 - 2005-07-26 08:11 PM Re: Running kxrpc or execute application on remote system
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
OK doing it this way!!
Code:
 
sComputer = "SERVER" 'replace with name of target computer
sService = "SERVICE" 'replace with name of the service to be started

Set oInstance = GetObject("winmgmts:{impersonationLevel=impersonate}//" & sComputer & _
"/root/cimv2:Win32_Service=" & Chr(34) & sService & Chr(34))
Set oOutParam = oInstance.ExecMethod_("StartService")

If oOutParam.ReturnValue = 0 Then
WScript.Echo oInstance.Name & " started successfully"
Else
WScript.Echo oInstance.Name & " failed to start"
Select Case oOutParam.ReturnValue
Case 1 WScript.Echo "The request is not supported."
Case 2 WScript.Echo "The user did not have the necessary access."
Case 3 WScript.Echo "The service cannot be started because it depends " & _
"on other services that are not running."
Case 4 WScript.Echo "The requested control code is not valid, or " & _
"it is unacceptable to the service."
Case 5 WScript.Echo "The requested control code cannot be sent to " & _
"the service because the state of the service."
Case 6 WScript.Echo "The service has not been started."
Case 7 WScript.Echo "The service did not respond to the start request " & _
"in a timely fashion."
Case 8 WScript.Echo "Unknown failure when starting the service."
Case 9 WScript.Echo "The directory path to the service executable was not found."
Case 10 WScript.Echo "The service is already running"
Case 11 WScript.Echo "The database to add a new service is locked."
Case 12 WScript.Echo "A dependency for which this service relies on " & _
"has been removed from the system."
Case 13 WScript.Echo "The service failed to find the service needed " & _
"from a dependent service."
Case 14 WScript.Echo "The service has been disabled from the system."
Case 15 WScript.Echo "The service does not have the correct authentication " & _
"to run on the system."
Case 16 WScript.Echo "This service is being removed from the system."
Case 17 WScript.Echo "There is no execution thread for the service."
Case 18 WScript.Echo "There are circular dependencies when starting the service."
Case 19 WScript.Echo "There is a service running under the same name."
Case 20 WScript.Echo "There are invalid characters in the name of the service."
Case 21 WScript.Echo "Invalid parameters have been passed to the service."
Case 22 WScript.Echo "The account, which this service is to run under is " & _
"either invalid or lacks the permissions to run the service."
Case 23 WScript.Echo "The service exists in the database of services " & _
"available from the system."
Case 24 WScript.Echo "The service is currently paused in the system."
End Select
End If

_________________________
www.microcyb.com

Top
#144310 - 2005-07-28 03:29 AM Re: Running kxrpc or execute application on remote system
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
It seems you're confusing service with application. tere are several UDFs to control and start services. There are also examples to remotely execute applications e.g. via PSEXEC, Task Scheduler, or WMI.

Maybe you should descibe in detail what you try to accomplish.
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 530 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.055 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org