Convert VBS to exe


I wrote a VBS script to run a program as another user, but the problem is the password is stored in plain text as the user. If possible, I would like to convert a VBS to a true exe, or just find a way to hide the password.
So far all the programs i've found convert it to a self extracting exe. Any suggestions on programs? Or anyone know a script that can accomplish what i'm trying to do? I'm open for any of these.

Thanks in advance.
Who is Participating?
Todd GerbertConnect With a Mentor IT ConsultantCommented:
Here's the link to the encoder:
And here's what your script looks like once it's encoded (save it with a .VBE extension to run it (that's VB Encoded))

#@~^DgIAAA==v,OR O P2X+U^DbwOP}wOrKx/,$+Tkx,RRO O@#@&vPj^Mk2Y:zw)~AbxNGABkU\KVD@#@&B,f+kYGrDmOWMXl~D+:a@#@&EPq1GU),N0CEsO@#@&vP};YaEOobV+l~;)wKmahDna-:5!O-~rx'KC6qW.Vk-YdYc+6@#@&B,O ORO~3X+jmMrwDP62DkWUd,2UN,R OR @#@&rwDkKUP62VbmrO@#@&NbhPK?tss@#@&/Y~Wj4Vs',	/1Dr2DRZ.nmYnr(%mOvJq?mMkaORUtnV^Jb@#@&W?4nV^RI!U~JME	ldP&;k+.)m[:bxrdDDlOGMPEJk2^ld4!OR+X+rEJ@#@&	?1Dr2DR?^n+aPFZT@#@&EIwsl^n,Y4+,dYMkUL,XW;.ald/SGMN=,4VWSPSrY4@#@&BDtn~al/kAWMNP!dnN,W	PzW;.,/z/Dn:cP(U1VE[n,YrV9n@#@&GUtVVc?UN0+z/,Jhzal/kAWMNUr@#@&kmMk2Y }!kO@#@&f6YAAA==^#~@

Open in new window

Todd GerbertIT ConsultantCommented:
Microsoft used to have available a VBScript Encoder, not sure if it's still around by try searching at
It's not full-proof encryption, but obfuscate the password and prevent casual viewers from seeing it.
Steve KnightIT ConsultancyCommented:
Depending upon what your script is and does using ADS as suggested here by t0t0  may be suitable in that you can hide your password in an alternate date stream which is effectively not there unless you know how to find it...

Can we se what your script is doing and maybe it can be revised to use such methods?

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

dscitsAuthor Commented:
Ok thanks i'll give that a try, I don't have time right now but i'll get back to you once I do. Meanwhile heres the script, so If you have any suggestions let me know. I found this online so I didn't handwrite it.

' ----- ExeScript Options Begin -----
' ScriptType: window,invoker
' DestDirectory: temp
' Icon: default
' OutputFile: C:\TaxPrep\TY09\Bin\TaxWorks\test.exe
' ----- ExeScript Options End -----
Option explicit
dim oShell
set oShell= Wscript.CreateObject("WScript.Shell")
oShell.Run "runas /user:administrator ""splash09.exe"""
WScript.Sleep 100
'Replace the string yourpassword~ below with
'the password used on your system. Include tilde
oShell.Sendkeys "mypassword~"
dscitsAuthor Commented:
Awesome thanks! I'll have to re-encode it with my password, But that should be the solution, I'll try it right now!
dscitsAuthor Commented:
OK so that worked like a charm, thanks. So for the future people reading this I downloaded VBScript Encoder and encoded it.
To do that, open a command prompt and change to the directory you installed VBScript encoder to,
cd C:\program Files\Windows Script Encoder

Then I copied the VBS script to encode to the directory and ran
screnc.exe /f test.vbs         (it will overwrite your vbs file)

and rename the extension to test.vbe and it worked. Thanks!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.