473,406 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Convert VBS file to vb.net

I have a vbs file (WScript) that I need to convert to vb.net; is there any
tools available for that?
Jun 27 '08 #1
13 2931
None that I know of. I think you'd copy/paste/fix.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Jun 27 '08 #2
On Apr 28, 12:18*pm, Rick <R...@discussions.microsoft.comwrote:
I have a vbs file (WScript) that I need to convert to vb.net; is there any
tools available for that? *
I'm not aware of any. VBS was based on VB6, so it would be very
similar to converting VB6 to VB.NET, only a VBS is a stand alone piece
of code that is normally interpeted, not compiled.
Jun 27 '08 #3
But don't paste, instead use the "Upgrade Visual Basic 6 Code ... " item
from the Tools menu.
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:ec**************@TK2MSFTNGP02.phx.gbl...
None that I know of. I think you'd copy/paste/fix.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Jun 27 '08 #4
For VBS? I doubt that would do much. Of course, VBS <VB6 (I think).

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Jun 27 '08 #5

"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:eI**************@TK2MSFTNGP02.phx.gbl...
For VBS? I doubt that would do much. Of course, VBS <VB6 (I think).
Yeh should do, as VBS is a subset of VB6. The "Upgrade Visual Basic 6 Code
...." tool allows you to paste code into it, set references etc, and it will
do it's magic.

Jun 27 '08 #6

"Bill McCarthy" <Bi**@N0SPAM.comschreef in bericht
news:Ol**************@TK2MSFTNGP05.phx.gbl...
>
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:eI**************@TK2MSFTNGP02.phx.gbl...
>For VBS? I doubt that would do much. Of course, VBS <VB6 (I think).

Yeh should do, as VBS is a subset of VB6. The "Upgrade Visual Basic 6
Code ..." tool allows you to paste code into it, set references etc, and
it will do it's magic.
?????????????????????????????????????

What has VB6 to do with VBS, VBS did exist far before VB6.

As you had written VB6 contains a subset of VBS than it would have been a
little bit more in the direction.

However VB for Net has the same, so I would keep by Dick's first answer.
There was at least for me nothing to add to that, I would have written it
almost exactly the same.

Cor

Jun 27 '08 #7

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:D6**********************************@microsof t.com...
>
"Bill McCarthy" <Bi**@N0SPAM.comschreef in bericht
news:Ol**************@TK2MSFTNGP05.phx.gbl...
>>
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:eI**************@TK2MSFTNGP02.phx.gbl...
>>For VBS? I doubt that would do much. Of course, VBS <VB6 (I think).

Yeh should do, as VBS is a subset of VB6. The "Upgrade Visual Basic 6
Code ..." tool allows you to paste code into it, set references etc, and
it will do it's magic.
?????????????????????????????????????

What has VB6 to do with VBS, VBS did exist far before VB6.

As you had written VB6 contains a subset of VBS than it would have been a
little bit more in the direction.
Absolutely not. VBScript is a derivative of VB. It was developed
originally for IE after VB4, then updated alongside VB5.
The upgrade wizard will fix much of the code, changing Integer to Short etc,
removing Set, Intialize to New, Terminate to Finally, and all those kind of
things.
However VB for Net has the same, so I would keep by Dick's first answer.

Huh ? Why manually convert somethign when the wizard will do it for you ?



Jun 27 '08 #8

"Bill McCarthy" <Bi**@N0SPAM.comschreef in bericht
news:55**********************************@microsof t.com...
>
"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:D6**********************************@microsof t.com...
>>
"Bill McCarthy" <Bi**@N0SPAM.comschreef in bericht
news:Ol**************@TK2MSFTNGP05.phx.gbl...
>>>
"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:eI**************@TK2MSFTNGP02.phx.gbl...
For VBS? I doubt that would do much. Of course, VBS <VB6 (I think).
Yeh should do, as VBS is a subset of VB6. The "Upgrade Visual Basic 6
Code ..." tool allows you to paste code into it, set references etc, and
it will do it's magic.
?????????????????????????????????????

What has VB6 to do with VBS, VBS did exist far before VB6.

As you had written VB6 contains a subset of VBS than it would have been a
little bit more in the direction.

Absolutely not. VBScript is a derivative of VB. It was developed
originally for IE after VB4, then updated alongside VB5.
The upgrade wizard will fix much of the code, changing Integer to Short
etc, removing Set, Intialize to New, Terminate to Finally, and all those
kind of things.
Are you tired from a long trip or something?

You write "Absolute not" Or do you have the idea that VB6 was developed
before VB5.
>However VB for Net has the same, so I would keep by Dick's first answer.


Huh ? Why manually convert somethign when the wizard will do it for you ?
Because in this case there will not be anything different.

VBS does not use the same methods to use objects as VB6, by instance
DataBase access and Web access is completely different handled. (I have
done a lot in classic ASP, the keywords you are talking about I thought
never to have used in VBS, only declared once because everything is
global ).
The "Set" is automaticly removed by VB for Net by the way. You cannot even
use it.

To show it, try this and remove the double quotes around Set

Dim a As String
"Set" a = "1"

I wished that declaring variables (inside methods) i = 10 would be
optional possible in VB for Net.

However the strong advocacy from old VB6 users prefents that, because they
cannot think without that there is written Dim before it, even in a Global
situation, where this in my idea even should be avoided.

However, just my opinion.

Cor

Jun 27 '08 #9

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:92**********************************@microsof t.com...
>
"Bill McCarthy" <Bi**@N0SPAM.comschreef in bericht
news:55**********************************@microsof t.com...
>>
"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:D6**********************************@microso ft.com...
>>>
"Bill McCarthy" <Bi**@N0SPAM.comschreef in bericht
news:Ol**************@TK2MSFTNGP05.phx.gbl...

"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:eI**************@TK2MSFTNGP02.phx.gbl...
For VBS? I doubt that would do much. Of course, VBS <VB6 (I
think).
>

Yeh should do, as VBS is a subset of VB6. The "Upgrade Visual Basic 6
Code ..." tool allows you to paste code into it, set references etc,
and it will do it's magic.

?????????????????????????????????????

What has VB6 to do with VBS, VBS did exist far before VB6.

As you had written VB6 contains a subset of VBS than it would have been
a little bit more in the direction.

Absolutely not. VBScript is a derivative of VB. It was developed
originally for IE after VB4, then updated alongside VB5.
The upgrade wizard will fix much of the code, changing Integer to Short
etc, removing Set, Intialize to New, Terminate to Finally, and all those
kind of things.
Are you tired from a long trip or something?

You write "Absolute not" Or do you have the idea that VB6 was developed
before VB5.

Huh ? Vb5 is a subset of Vb6 right ? *Everything* you can do in VBScript,
you can do in VB6. VB6 has more features, hence VBScript is a subset.

>>However VB for Net has the same, so I would keep by Dick's first
answer.


Huh ? Why manually convert somethign when the wizard will do it for you
?
Because in this case there will not be anything different.
Really. What about code like myColor = vbBlack ?
Or date operations Or the Sqr function etc.
VBS does not use the same methods to use objects as VB6, by instance
DataBase access and Web access is completely different handled. (I have
done a lot in classic ASP, the keywords you are talking about I thought
never to have used in VBS, only declared once because everything is
global ).

It's still the same objects, still the same COM libraries.

The "Set" is automaticly removed by VB for Net by the way. You cannot even
use it.

To show it, try this and remove the double quotes around Set

Dim a As String
"Set" a = "1"

I wished that declaring variables (inside methods) i = 10 would be
optional possible in VB for Net.

However the strong advocacy from old VB6 users prefents that, because they
cannot think without that there is written Dim before it, even in a Global
situation, where this in my idea even should be avoided.

However, just my opinion.

Cor
Jun 27 '08 #10
OK. I've never used VBS, so I didn't realize that it was that compatible.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Jun 27 '08 #11
Yeh it's the same. Even has classes, property Lets and Gets and Sets.. yet
everything is a variant implicitly ;)

"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:u8****************@TK2MSFTNGP05.phx.gbl...
OK. I've never used VBS, so I didn't realize that it was that compatible.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Jun 27 '08 #12
Bill,

There is a VB language and there is are a VB tool like VB 2008 .

VB Net 2008 by instance is based on VB version 9.

VBS is more or less compatible with all those versions, but not particular
to version 6.

Therefore I stay by the idea that your idea will only give a lot of extra
work for the OP, maybe he start enthousiast but after a time he will see
that what Dick wrote is a better option.

Cor

"Bill McCarthy" <Bi**@N0SPAM.comschreef in bericht
news:6F**********************************@microsof t.com...
Yeh it's the same. Even has classes, property Lets and Gets and Sets.. yet
everything is a variant implicitly ;)

"Dick Grier" <dick_grierNOSPAM@.msn.comwrote in message
news:u8****************@TK2MSFTNGP05.phx.gbl...
>OK. I've never used VBS, so I didn't realize that it was that
compatible.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications,
Fourth Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
Jun 27 '08 #13
It's not. That's a common misperception, especially
among C++ programmers who tend to lump anything
that looks basic-esque into one pile they call "VB".

There are even large differences in VBS where it's
used for ASP vs WSH vs webpage scripting. A simple
VBScript can often go directly into VB6 code, but anything
that's at all involved would probably need a rewrite.
And if it's going to be translated as reasonably good code
it would need a total rewrite, since VBScript is almost
always using slow, limited COM objects with dependencies,
like FileSystemObject and WScript.Shell.
I don't know anything about the VB -VB.Net converter,
but I can't imagine that it's going to make much sense of
those objects, or of things like methods of the WScript
object, which only exists in the WSH context.
OK. I've never used VBS, so I didn't realize that it was that compatible.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.


Jun 27 '08 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: hunterb | last post by:
I have a file which has no BOM and contains mostly single byte chars. There are numerous double byte chars (Japanese) which appear throughout. I need to take the resulting Unicode and store it in a...
7
by: whatluo | last post by:
Hi, all I'm now working on a program which will convert dec number to hex and oct and bin respectively, I've checked the clc but with no luck, so can anybody give me a hit how to make this done...
1
by: Daniel | last post by:
I have looked everywhere on the web for an answer to this and the only thing I can find is converting the image format when the file is present on the local filesystem. What I want to do is use a...
7
by: Scott Schluer | last post by:
Is there a way to use the Image class to convert a color photo (GIF or JPEG) to a B&W photo? Thanks, Scott
3
by: Thubaiti | last post by:
Hi, I have this code in my ASP.NET and I want to convert it to C# (code behind) <asp:Repeater id="subCategoryRepeater" runat="server"> <ItemTemplate> <ul> <li> <asp:HyperLink...
12
by: Brian Henry | last post by:
first question... I have a flat file which unfortinuatly has columns seperated by nulls instead of spaces (a higher up company created it this way for us) is there anyway to do a readline with this...
5
by: melickas | last post by:
We designed a custom application using Office Developer Tools '97 which included a Run-time version of Access--- so it would not matter if our customer even had any version of Access on their...
6
by: PenguinPig | last post by:
Dear All Experts I would like to know how to convert a HTML into Image using C#. Or allow me contains HTML code (parsed) in Image? I also tried this way but it just display the character "<" &...
5
by: sonu | last post by:
hey good morning ...... how to convert a video file in .flv format in php for linux hosting......is there any package whis provide this facility . Can i use ffmpeg for linux hosting...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.