Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remote run of local application

Status
Not open for further replies.

Bodhis3mta3

Programmer
Feb 11, 2004
7
US
This is probably the most insecure request one IT professional could make of another, and if it works, maybe I should batten down my hatches a little tighter...

I have a sysinfo app that has a server side that runs on machines, and you connect remotely to that server-side app to run reports. I can run this server side app remotely from my own shared docs (thus eliminating the need to INSTALL it everywhere) and with a few switches, completely under the radar.

I've tried this:

Set WshShell = WScript.CreateObject("WScript.Shell")
RunApp = WshShell.Run ("""\\mybox\Documents\System Info\sysinfo.exe"" /hidden /silent" , , True)
set wshshell=nothing

But it starts the process on my own machine.


I'd like to know how to script either a remote "call" to this app from thier shared docs or schedule it to be called on the remote machine at whenever. I can't dump a VB script in the start up folder of every machine, cuz then I'd have to go around allaying fears when thier AV goes haywire. I can't ask these people to run this themselves cuz a) most couldn't navigate to my shared docs anyway and b) most are suspicious of IT initiatives after a harrowing computer monitoring fiasco among management. I'd rather just do this as auto as I can.

I realize that this is a super-huge potential security risk, but if I have to do it manually, I'd rather skip it altogether.

Thanks for all the help in advance.

the bodhisattva
 
Hello Bodhis3mta3,

You can try this.
Code:
shost="\\mybox"
spath="c:\Documents\System Info\sysinfo.exe"    '<<input the exact path on the server
scmd=spath & " /hidden /silent"

set svcproc=createobject("winmgmts:" & shost & "\root\cimv2:win32_process")
iret=svcproc.create(scmd,nul,nul,pid)
if iret<>0 then
    wscript.echo "Process failed to launched (code " & iret & ")"
else
    wscript.echo "Process launched successfully."
end if
set svcproc=nothing
regards - tsuji
 
tsuji, aces again! Nice script.

Only problem with doing it this way is that the process is not interactive if the user needs that. If this process will run and terminate itself then no big deal. Otherwise I would suggest use PSEXEC from Sysinternals.

bodhisattva if you are not familiar with PSEXEC, it allows you to copy and execute comands on a remote machine and it does it in an interactive session. Remote processes launched via WMI are not interactive on anything after Win2K SP2. So the process will run but a user can't see it which is a real pain.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Correction:

Have to correct this careless mistake. The corresponding line should be read as:
[tt] set svcproc=[red]getobject[/red]("winmgmts:" & shost & "\root\cimv2:win32_process")[/tt]

Thanks for your attention.

- tsuji
 
tsuji and mark,

Thanks for all the help, but I'm having permission problems with these solutions. Since I didn't set up the network, but actually inherited a mish-mash of connected hardware, I have no way of knowing any Admin info. I think that all users have Admin profiles on their local machines, so running a process as a "user" is not possble, since there are no "user" accounts (correct?).

Ennyhoo, I think this is a Saturday morning project for the future. I'm too swamped with damage control 9 to 5 ;)!!

Thanks Again!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top