Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is it possible to compile a vbs script.

837 views
Skip to first unread message

Rose

unread,
May 30, 2003, 6:05:43 AM5/30/03
to
I have a script that I would like to convert to an executable exe file.
Is that possible ?
Can Visual Basic do that ?
Is there any other way ?

TIA
Tony

Oisin Grehan

unread,
May 30, 2003, 8:37:03 AM5/30/03
to
As far as I'm aware, no, it's not possible. But if you want to compile it
into an executable so as to hide the source, look on
msdn.microsoft.com/scripting/ for the Script Encoder. This will make it very
difficult for the casual user to observe the source code.

hope this helps,

- Oisin

"Rose" <To...@Antonio.com> wrote in message
news:bb7afu$ope$1...@news-reader14.wanadoo.fr...

Joseph Carlisle

unread,
May 30, 2003, 8:53:40 AM5/30/03
to
Like the other poster mentioned you can not compile a vbscript into an exe
but Visual Basic allows you to build exe's as well as controls and other
executable files.

-josephc


Sam Salhi [MSFT]

unread,
May 30, 2003, 12:37:04 PM5/30/03
to
You can convert your Vbscript to a VB file and compile it, the conversion
shouldn't be very difficult to do since vbscript is a subset of VB. (The
hard conversion is from VB to VBscript)

--
===========================================================
This posting is provided "AS IS" with no warranties and confers no rights
===========================================================


"Rose" <To...@Antonio.com> wrote in message
news:bb7afu$ope$1...@news-reader14.wanadoo.fr...

BitsNotBytes

unread,
May 30, 2003, 7:27:38 PM5/30/03
to
I mangle the source code with C++. I essentially rebuild the source
code using the MSVC string container and dump it to a file in one
write statement. That class is essentially the same as used by
JScript strings but I pass by address and not value. You'll never
seen any source code with a binary viewer. I create a temporary file
in the IE temporary directores and put an old date on it. I couldn't
find it if I wanted too. I use the CSCRIPT engine parameter so I
don't use .js or .vbs extentions but in this case .html. The first
lines of the source file DELETES itself. As insurance I remove it in
the C++ program. Even if you rename CSCRIPT and empty IE temporary
directories you'll never see what is going on. I intercept all
keyboard shenanigans like CTRL-BREAK and gracefully exit. I'm
currently looking at using file encryption for the source input. Even
if you change a bit the decryption is still garbage and wouldn't pass
a simple Engine validation. The upside one size fits all. It's not
as complicated as it sounds. The roadmap should suffice. Obviously
this works with any interpreted language where you protect the source
code. You make adjustments for the anomalies.

BitsNotBytes

"Sam Salhi [MSFT]" <sam...@online.microsoft.com> wrote in message news:<eBkM1msJ...@TK2MSFTNGP11.phx.gbl>...

Glenn Wilson

unread,
May 30, 2003, 11:28:34 PM5/30/03
to
I have been converting my VBscript files to vb.net this way they are
compiled.

Glenn

"Sam Salhi [MSFT]" <sam...@online.microsoft.com> wrote in message
news:eBkM1msJ...@TK2MSFTNGP11.phx.gbl...

Sam Salhi [MSFT]

unread,
May 31, 2003, 6:01:45 AM5/31/03
to
awesome :-)
You guys are very smart

--
===========================================================
This posting is provided "AS IS" with no warranties and confers no rights
===========================================================


"BitsNotBytes" <bitsno...@yahoo.com> wrote in message
news:946bf591.03053...@posting.google.com...

Sam Salhi [MSFT]

unread,
May 31, 2003, 6:02:33 AM5/31/03
to
as long as it works for you this is great

--
===========================================================
This posting is provided "AS IS" with no warranties and confers no rights
===========================================================


"Glenn Wilson" <gnwi...@optusnet.com.au> wrote in message
news:e$oujOyJD...@TK2MSFTNGP11.phx.gbl...

RERK

unread,
Jun 3, 2003, 1:30:14 PM6/3/03
to
How do convert from vbscript to vb.net ?
And indeed, what does that actually mean ?

Rose

"Glenn Wilson" <gnwi...@optusnet.com.au> a écrit dans le message de
news:e$oujOyJD...@TK2MSFTNGP11.phx.gbl...

larrydalooza

unread,
Jun 4, 2003, 11:17:40 AM6/4/03
to
> I have a script that I would like to convert to an executable exe file.
> Is that possible ?

There are freeware 'bundlers', one named "bundler", that stores your
file as an EXE then upon execution it extracts your file and 'opens'
it with it's 'associated' program...

here, found a link...

http://users.hol.gr/~dck/g4c/res/bundler.htm

Larry

larrydalooza

unread,
Jun 4, 2003, 11:19:03 AM6/4/03
to
I sent you the wrong link, sorry... look for "bundler"

Larry

larrydalooza

unread,
Jun 4, 2003, 7:14:34 PM6/4/03
to
I just created this...

http://groups.yahoo.com/group/AutoItList/files/MISC/File2EXE.exe

It will create an EXE from 'ANY file'. When you launch that EXE it
will extract the 'ANY file' to the %temp% directory and launch it with
it's "Associated" program. It passes up to 9 arguments to that file
also, in case your .vbs accepts arguments. It is not totally stealth,
but discourages people from looking at your .vbs code...

visit me at
http://groups.yahoo.com/group/AutoItList/
if you have any questions

Larry

Paul Randall

unread,
Jun 4, 2003, 8:12:38 PM6/4/03
to

"larrydalooza" <larryd...@yahoo.com> wrote in message news:41eb6005.03060...@posting.google.com...

> I just created this...
>
> http://groups.yahoo.com/group/AutoItList/files/MISC/File2EXE.exe
>
> It will create an EXE from 'ANY file'. When you launch that EXE it
> will extract the 'ANY file' to the %temp% directory and launch it with
> it's "Associated" program. It passes up to 9 arguments to that file
> also, in case your .vbs accepts arguments. It is not totally stealth,
> but discourages people from looking at your .vbs code...
>
> visit me at
> http://groups.yahoo.com/group/AutoItList/
> if you have any questions
>
> Larry
>

Hi, Larry
This looks like it could be useful. But...
On my W98SE, IE5.5, WSH 5.6 system, it puts the original script in the %temp% directory, but does not launch it.

I just tried a one-liner:
msgbox "hello"

It displays the messagebox when I double click the file in %temp%.

-Paul Randall


Paul Randall

unread,
Jun 4, 2003, 8:36:43 PM6/4/03
to
larrydalooza wrote:
> I just created this...
>
> http://groups.yahoo.com/group/AutoItList/files/MISC/File2EXE.exe
>
> It will create an EXE from 'ANY file'. When you launch that EXE it
> will extract the 'ANY file' to the %temp% directory and launch it with
> it's "Associated" program. It passes up to 9 arguments to that file
> also, in case your .vbs accepts arguments. It is not totally stealth,
> but discourages people from looking at your .vbs code...
>
> visit me at
> http://groups.yahoo.com/group/AutoItList/
> if you have any questions
>
> Larry

Hi, Larry
Leaving the source in the %temp% directory seems foolish.
Can your launcher pass something to the script so that code like this can delete it before anyone has a chance to look at it?

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
'If I was started by File2EXE then
' objFSO.DeleteFile WScript.ScriptFullName
'End If
...
'The rest of the script

-Paul Randall


larrydalooza

unread,
Jun 5, 2003, 1:27:00 AM6/5/03
to
> Hi, Larry
> Leaving the source in the %temp% directory seems foolish.
> Can your launcher pass something to the script so that code like this can delete it before anyone has a chance to look at it?

You'd laugh if you knew how I made this... I will try to delete after
it runs... but for now, I just hacked it together to discover the
possibilities.

Larry

larrydalooza

unread,
Jun 5, 2003, 1:42:17 AM6/5/03
to
> Hi, Larry
> Leaving the source in the %temp% directory seems foolish.
> Can your launcher pass something to the script so that code like this can delete it before anyone has a chance to look at it?

try this one... it 'should' delete the file after it closes.

http://groups.yahoo.com/group/AutoItList/files/MISC/File2EXE.exe

Larry

Paul Randall

unread,
Jun 5, 2003, 9:41:23 AM6/5/03
to

"larrydalooza" <larryd...@yahoo.com> wrote in message news:41eb6005.03060...@posting.google.com...

Hi, Larry
Two problems:
1. When I run the executable created by File2EXE.exe, it creates the original .VBS in %temp%, but it never launches it. I proved
that to myself by having two lines in the .VBS -- a 60-second sleep and a message box. The message box never shows up, and if I do
control-alt-delete immediately after running the executable, there is no entry for it in the close-program list.

How are you launching it?

2. The deletion of the script should occur as soon as it is loaded, not after it has completed running. If I insert the deletion
code at the beginning of my script, it does the deletion and runs to completion (but I can't run it again for testing because it is
gone). So I wanted a way to test the script without self-deletion, while retaining the automatic deletion when created by running
the executable created by File2EXE.exe.
Thus code like this at the beginning of the script:


Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
'If I was started by File2EXE then
' objFSO.DeleteFile WScript.ScriptFullName
'End If

-Paul Randall


larrydalooza

unread,
Jun 5, 2003, 1:13:22 PM6/5/03
to
> How are you launching it?

With AutoIt's RunWait command (uses CreateProcess) and
"%comspec%" /c start /w "x:\full\path\to.exe"

start /w uses the registry to discover the files associated program.
If no program is associated, then nothing happens... I guess.. I could
trap the %errorlevel% and pass that out the ass end of the process, I
spose... Anyway... this is not created with a programming language,
but with elements from AutoIt.

Larry

0 new messages