Page 1 of 1 1
Topic Options
#160371 - 2006-04-05 11:47 AM RemoteEXEC
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Hi,

I am using the FnRemoteExec UDF and trying to get word to launch on a remote machine, however instead the following code tries to launch the file on my machine. Where am I going wrong?

Code:
 	 $rc = fnRemoteExec('c:\program files\microsoft office\office10\winword.exe c:\wutemp\' + $filename, $Computer) 
Run $rc



I have def passed the remote machines parameter in $Computer!

Many thanks.

Ste
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#160372 - 2006-04-05 11:49 AM Re: RemoteEXEC
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Sorry somehow has posted twice...
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#160373 - 2006-04-05 12:20 PM Re: RemoteEXEC
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
First off - according to the udf-lib, it's RemoteExec(),
second, don't do a run $rc.

RemoteExec('regsvr32 c:\winnt\system32\kixforms.dll /s', "somecomputer")

Regarding the doublepost, you can remove it so long noone has answered to it.
note :
;REMARKS As this execs under the remote PCs system context, the user gets no interaction with the process
; and the process has no permission to network resources... local & silent commands only
Code:

;FUNCTION RemoteExec()
;
;ACTION Uses WMI to create a process on a remote PC
;
;AUTHOR Radimus
;
;CONTRIBUTORS A whole bunch of us
;
;VERSION 1.0
;
;DATE CREATED 3/25/2003
;
;DATE MODIFIED
;
;KIXTART 4x
;
;SYNTAX RemoteExec($command, optional $computer)
;
;PARAMETERS $Command
; the command to execute on remote PC (check the paths, best bet is to pust a batch file and exec that)
;
; optional $Computer
; target PC, if blank defaults to local
;
;RETURNS @error
;
;REMARKS As this execs under the remote PCs system context, the user gets no interaction with the process
; and the process has no permission to network resources... local & silent commands only
;
;DEPENDENCIES Kix 4.x, WMI, see remarks
;
;EXAMPLE RemoteExec('regsvr32 c:\winnt\system32\kixforms.dll /s', $computer)
;
;KIXTART BBS http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000384
;
;
FUNCTION RemoteExec($command, optional $computer)
dim $Connect, $Process
if not $computer $computer='.' endif
if instr($computer,'\')
$computer=substr($computer,instrrev($computer,'\')+1)
endif
$Connect = GetObject('winmgmts:{impersonationLevel=impersonate}!//'+$computer+'/root/cimv2:Win32_Process')
$Process = $Connect.Create($Command)
exit @error
ENDFUNCTION



Edited by ewook (2006-04-05 12:21 PM)
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#160374 - 2006-04-05 12:29 PM Re: RemoteEXEC
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Many thanks!

Can you pass a local system account so that the user has the correct rights. Is there any way to run the process interactively?

Steve.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#160375 - 2006-04-05 01:08 PM Re: RemoteEXEC
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
no

The only POSSIBLE way would be if BOTH user's were using the same account, but I haven't tested that.

The remoteExec acct is SYSTEM, so it has local admin, but doesn't interact with the user at all (unless it reboots, in which case the user will see it reboot).

Its target audience is the installation of applications, hotfixes, etc. Admin type tasks where the user doesn't have perms to go it under their security context.

If you want a method of starting apps or files remotely in the user context, the bext bet is to make a client script the starts from STARTUP or HKCU\...\run (runs as current user) that monitors a special folder, where you can remotely push commands / scripts
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#160376 - 2006-04-05 01:53 PM Re: RemoteEXEC
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
Hey Rad, it should work for nt4 aswell right? (of course with wmi installed)
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#160377 - 2006-04-05 03:49 PM Re: RemoteEXEC
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I'd think so, but I haven't seen an NT box in 4 years...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box
2023-09-28 [Arend_] Wow even the shouts are old ;-)
2023-11-17 [Dr_Rick] I love Kixforms!
2023-11-21 [Dave_Melczer] Getting DB errors again opening posts...anyone else?
2023-11-24 [Flavien] DB errors confirmed. This forum is showing its age... UBB 7.2.2 is from 2007
2023-11-27 [Sealeopard] And there goes the forum :-(
2023-11-30 [NTDOC] Yes, so old no good easy update path
2023-12-01 [mole] Posts back. No DB errors. Thanks!
2023-12-29 [BradV] Happy new year!
2024-02-09 [RSLHA] No access possible!
2024-02-09 [RSLHA] Database Error!
2024-02-18 [Dr_Rick] What happened to Bruno
2024-03-08 [mole] Thanks for getting the posts back again.
2024-04-17 [MarineV] db errors
2024-04-18 [MarineV] will the db errors get fixed????
2024-04-26 [Tonny] database error, please!
2024-05-09 [NTDOC] I'm not seeing any errors
2024-05-31 [chojin] DB is down again \:\(
2024-06-04 [selsner] Still no access, please help!
2024-06-07 [mole] Looks like DB is back again. Thanks.
2024-06-17 [It_took_my_meds] We encountered a problem. The reason reported was Database error only visible to forum administrators Please click back to return to the previous page.
2024-07-04 [Armin73] There is still a database error 🤷‍♂️
2024-07-09 [0neZero] There is still a database error 🤷‍♂️
2024-07-10 [Allen] DB working a few times in between the messages above. Working again as of 7/10. Thanks Doc
2024-08-31 [NetGnostic] Bummer, the Database error is back.
2024-09-04 [NTDOC] Fourms are back up without error for the moment
2024-10-02 [Arend_] Wll still have database errors ;-)
2024-10-03 [Allen] Thanks to Doc... it's back.
2024-12-09 [chojin] could we move kixtart to a new place in order to keep it living ? maybe create a github page and a subreddit?
2024-12-10 [Allen] do know about moving it, but I know Doc is aware of the DB issue. Should be back online soon.
2024-12-10 [Allen] don't know...

Who's Online
0 registered and 249 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.06 seconds in which 0.024 seconds were spent on a total of 13 queries. Zlib compression enabled.

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