vbs to exe

P

Pietro Pesce

i have this vbs


On Error Resume Next
dim WshShell,FSO




sUser="++++++"
sPass="+++++++"
sCmd="+++++++"
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 FSO=Nothing
wscript.quit
end if

rc=WshShell.Run("runas /user:" & sUser & " " & CHR(34) & sCmd &
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 WshEnv=Nothing
set FSO=Nothing

wscript.quit


i have convert this to exe...ok...but if i run will open i window and
wait i password for the command runas -.-" while if i run this
in .vbs: wscript xxxx.vbs it work...

why?


tnx, Pietro
 
R

rowe_newsgroups

i have convert this to exe...ok...but if i run will open i window and
wait i password for the command runas -.-" while if i run this
in .vbs: wscript xxxx.vbs it work...

Sorry, but this sentence doesn't make since to me. I realize that
English probably isn't you're primary language, but could you please
try to clarify this sentence?

Thanks,

Seth Rowe
 
P

Pietro Pesce

Sorry, but this sentence doesn't make since to me. I realize that
English probably isn't you're primary language, but could you please
try to clarify this sentence?

Thanks,

Seth Rowe

mmmmmm
i dont speak good en ;)
this script .vbs work...
..exe no!

why?
 
R

rowe_newsgroups

mmmmmm
i dont speak good en ;)
this script .vbs work...
.exe no!

why?

Okay, how does the exe not work? Is it throwing an exception (if so
please share the message) or is it just not working?

Thanks,

Seth Rowe
 
P

Pietro Pesce

Okay, how does the exe not work? Is it throwing an exception (if so
please share the message) or is it just not working?

Thanks,

Seth Rowe- Nascondi testo tra virgolette -

- Mostra testo tra virgolette -



because dont open the program cambio_ip.exe in administrative
mode.....when i run the exe i see the window that question me the
password for runas... if i run the script "wscript aaa.vbs" the
program work.....
 
R

rowe_newsgroups

because dont open the program cambio_ip.exe in administrative
mode.....when i run the exe i see the window that question me the
password for runas... if i run the script "wscript aaa.vbs" the
program work.....

Post the code for the exe - I suspect you're not using impersonation
like we suggested in the other thread.

Thanks,

Seth Rowe
 
P

Pietro Pesce

Post the code for the exe - I suspect you're not using impersonation
like we suggested in the other thread.

Thanks,

Seth Rowe- Nascondi testo tra virgolette -

- Mostra testo tra virgolette -

the code is in the 1° post....i convert this vbs in a exe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top