#25598 - 2002-07-22 02:40 PM
how to pass command line with options to su.exe
|
lmichiel
Fresh Scripter
Registered: 2002-07-18
Posts: 18
|
Hi all
I'm trying to do the following:
setl "SU_COMMANDLINE=c:\epoagent\aginst32 /remove" setl "SU_DOMAIN=@domain" setl "SU_PASSWORD=xxxxx" shell "%comspec% /c su administrator"
But it goes wrong because of the /remove bit in the first line. Any clues?
btw suss.exe is running as service on the pc.
cheers Leo
|
Top
|
|
|
|
#25600 - 2002-07-22 02:48 PM
Re: how to pass command line with options to su.exe
|
lmichiel
Fresh Scripter
Registered: 2002-07-18
Posts: 18
|
To bad, it doesn't work: CreateProcessAsUser error! (rc=3) The system cannot find the path specified.
cheers Leo
|
Top
|
|
|
|
#25601 - 2002-07-22 02:54 PM
Re: how to pass command line with options to su.exe
|
Mark Bennett
Getting the hang of it
Registered: 2001-10-10
Posts: 70
|
I used RUNAS to achieve a switch in user. I found I had to also use ScriptIt (or AutoIt) to type the password (as RUNAS does not allow you to pipe the password into the command). The one thing I didn't like is the password was stored in a file somewhere which is a REALLY bad idea.
However the what I wanted to do was being done selectively and I knew who would be running the script and roughly when. So I put the password in a text file located in a hidden share and left it blank. Then the script would say, "This process has NOT been enabled. Please contact Mickey Mouse on 5551234!"
Mark
|
Top
|
|
|
|
#25603 - 2002-07-22 04:41 PM
Re: how to pass command line with options to su.exe
|
lmichiel
Fresh Scripter
Registered: 2002-07-18
Posts: 18
|
The script print the following: SU_COMMANDLINE="c:\epoagent\aginst32" /remove it down't give an error but it also doesn't perform the program with the /remove option
It seems that only c:\epoagent\aginst32 is being run
|
Top
|
|
|
|
#25605 - 2002-07-22 04:49 PM
Re: how to pass command line with options to su.exe
|
lmichiel
Fresh Scripter
Registered: 2002-07-18
Posts: 18
|
Yes, my machine is running XP prof
|
Top
|
|
|
|
#25607 - 2002-07-22 04:57 PM
Re: how to pass command line with options to su.exe
|
lmichiel
Fresh Scripter
Registered: 2002-07-18
Posts: 18
|
Yes but I'm not running it in a logon script yet, just locally on my PC. SO I don't use %0\..\
|
Top
|
|
|
|
#25609 - 2002-07-22 05:08 PM
Re: how to pass command line with options to su.exe
|
lmichiel
Fresh Scripter
Registered: 2002-07-18
Posts: 18
|
I've entered the variables manually but still su doens't work If I enter %SU_COMMANDLINE% on the command prompt, the program runs correctly so it seems to have to do with su.exe (and suss.exe)
I got those from Bryce'S Kix Library
|
Top
|
|
|
|
#25610 - 2002-07-22 05:13 PM
Re: how to pass command line with options to su.exe
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Lonkero..
It has to be C:\epoagent\aginst32.exe /remove
Leo - How about:
setl 'SU_COMMANDLINE="c:\epoagent\aginst32 /remove"'
Does that work?
Kent
|
Top
|
|
|
|
#25612 - 2002-07-22 05:21 PM
Re: how to pass command line with options to su.exe
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
OK..
Here we go..
Try this..
code:
$Removecmd = READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Application Plugins\ePOAgent2000","Uninstall Command")
setl "SU_COMMANDLINE="+$Removecmd
Does this help?
Kent
|
Top
|
|
|
|
#25613 - 2002-07-22 05:43 PM
Re: how to pass command line with options to su.exe
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
May I ask why you are trying to remove the ePO Agent? We just upgraded our enterprise and the Agents have all updated across the domain with little or no issue. We went from ePO 2.0 to 2.52.
The upgrade was also completed on locked down workstations too.
Thank you,
Kent
|
Top
|
|
|
|
#25614 - 2002-07-22 06:30 PM
Re: how to pass command line with options to su.exe
|
lmichiel
Fresh Scripter
Registered: 2002-07-18
Posts: 18
|
We're using epo with quite some success. However sometimes it happens that the client stops communicating with the server. So only uninstalling this client and reinstalling makes it working again (installing it again over th old installation doesn help)
I've written a perl script which checks for the last communication with the server and if this is longer than 7 days ago, it must remove th old client and reinstall it. It works like a charm on Win 9x machines but I want this to work on Win 2K as well. I've got a kixstart version of the perl script I use so I want to get this working with SU before I try to use it with perl (the perl script is about 4 times faster)
|
Top
|
|
|
|
#25615 - 2002-07-22 06:33 PM
Re: how to pass command line with options to su.exe
|
lmichiel
Fresh Scripter
Registered: 2002-07-18
Posts: 18
|
quote: ry this..
code: --------------------------------------------------------------------------------
$Removecmd = READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\ePolicy Orchestrator\Application Plugins\ePOAgent2000","Uninstall Command")
--------------------------------------------------------------------------------
setl "SU_COMMANDLINE="+$Removecmd
Does this help?
Sorry, no go . It has to do with SU because the command works if I enter it as %SU_COMMANDLINE% on the command prompt
|
Top
|
|
|
|
#25617 - 2002-07-22 07:09 PM
Re: how to pass command line with options to su.exe
|
lmichiel
Fresh Scripter
Registered: 2002-07-18
Posts: 18
|
$passwd="chrompack" settitle("logonscript") setfocus ("logonscript") setconsole ("foreground") run '%windir%\System32\runas.exe /user:administrator "c:\epoagent\aginst32.exe /remove "' sleep 0.3 sendkeys ($passwd) sendkeys (chr(13))
THIS DOES THE TRICK WITHOUT SU! OK it isn't very neat but it works and it is just as (un)safe as using SU. I found this one somewhere hidden on this forum :-)
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 980 anonymous users online.
|
|
|