Page 1 of 1 1
Topic Options
#135142 - 2005-03-09 04:08 PM Send Parameters to Command-Line
Anonymous
Unregistered


Hello,

i've got a Problem with a Kix-Script. I wrote it in here already yesterday but
I have a new Idea. But first of all my problem is, that i need to install some
applications with Kix, but the users in our company don't have the rights to
install any software. I know that it is possible to install the applications with
software systems like IBM Tivoli or so, but my chef decided that we have to install
it by the LogonScript...

So is it possible to use some "Comand-Line"-Tools where I can change the user, install
the application and then go on in the LogonScript?

But how could I make it in a KIX-Script, I mean how can I start the tool and gave
the needed parameters like usernema and password...

I must send this command:

c:\lsrunas /user:..... /password:...... /domain:....... /command:....... /runpath:....

is this possible with a KIX.Script?

And is there any way to cryp the password???

Thanks for the help..

Greetings
schiba82

Top
#135143 - 2005-03-09 11:16 PM Re: Send Parameters to Command-Line
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Schiba,

There are lots of topics about Runas and encode the password. As far as I know you can't use Runas. In VBScript you can. There is still the password problem. You can use the Script encoder but on the internet you can download Script decoders so that isn't very secure...

Another option is a Adminscript. Use the taskscheduler to install software. Search the board for taskscheduler, jt.exe. There are lots of threads which can help you out.

_________________________
Co


Top
#135144 - 2005-03-09 11:21 PM Re: Send Parameters to Command-Line
Co Offline
MM club member
***

Registered: 2000-11-20
Posts: 1342
Loc: NL
Here is a script in VBS which you can use:

Code:




'**Start Encode**

On Error Resume Next
dim WshShell,oArgs,FSO

'strCmd=inputbox("Enter command to run:","Super User Command Interface","")

'set oArgs=wscript.Arguments

'if InStr(oArgs(0),"?")<>0 then
'wscript.echo VBCRLF & "? HELP ?" & VBCRLF
'Usage
'end if
'
'if oArgs.Count <1 then
'wscript.echo VBCRLF & "! Usage Error !" & VBCRLF
'Usage
'end If

sUser="administrator"
sPass="password" & VbCrLf
strCmd ="notepad.exe"


set WshShell = CreateObject("WScript.Shell")
set WshEnv = WshShell.Environment("Process")
WinPath = WshEnv("SystemRoot")&"\System32\runas.exe"
set FSO = CreateObject("Scripting.FileSystemObject")

if FSO.FileExists(winpath) then
'wscript.echo winpath & " " & "verified"
Else
wscript.echo "!! ERROR !!" & VBCRLF & "Can't find or verify " & winpath &"." & VBCRLF & "You must be running Windows 2000 for this script to work."
set WshShell=Nothing
set WshEnv=Nothing
set oArgs=Nothing
set FSO=Nothing
wscript.quit
end If

rc=WshShell.Run("runas /user:" & sUser & " " & CHR(34) & strCmd & CHR(34), 2, FALSE)
Wscript.Sleep 30 'need to give time for window to open.
WshShell.AppActivate(WinPath) 'make sure we grab the right window to send password To
WshShell.SendKeys sPass 'send the password to the waiting window.

set WshShell=Nothing
set oArgs=Nothing
set WshEnv=Nothing
set FSO=Nothing

wscript.quit

'************************
'* Usage Subroutine *
'************************
Sub Usage()
On Error Resume Next
msg="Usage: cscript|wscript vbrunas.vbs Username Password Command" & VBCRLF & VBCRLF & "You should use the full path where necessary and put long file names or commands" & VBCRLF & "with parameters in quotes" & VBCRLF & VBCRLF &"For example:" & VBCRLF &" cscript vbrunas.vbs quilogy\jhicks luckydog e:\scripts\admin.vbs" & VBCRLF & VBCRLF &" cscript vbrunas.vbs quilogy\jhicks luckydog " & CHR(34) &"e:\program files\scripts\admin.vbs 1stParameter 2ndParameter" & CHR(34)& VBCRLF & VBCRLF & VBCLRF & "cscript vbrunas.vbs /?|-? will display this message."

wscript.echo msg

WScript.quit

end Sub
'End of Script


_________________________
Co


Top
#135145 - 2005-03-09 11:22 PM Re: Send Parameters to Command-Line
Jose Offline
Seasoned Scripter
*****

Registered: 2001-04-04
Posts: 693
Loc: Buenos Aires - Argentina
Sorry Co didnt realized you where answering while I was writing . Sup BTW?

schiba82:
There are several ways of doing this.
Installing an Application as an Admin

And...

ScheduleTask() funtcion from Jens, can be cofigured to run at the same moment the script is running with credentials not encrypted. You will only have to copy JT.exe (think is in NTRESKIT) to system folder.

The problem is the encryption stuff.
Good solution is KiXcrypt editor that compiles an exe file.....BTW cool editor too. Dunno if it has been discotinued, check here new name is ASE.
_________________________
Life is fine.

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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.062 seconds in which 0.035 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