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