How do one use visual studio .net to write scripts?

J

Jacques Koorts

Hi there,

I just bought .NET and would like to use it to write my scripts. I only
played about 15 minutes with it trying to see if there is an easy wizard to
create the environment for writing script files for WSH.

Have any of you get this to work? If so can you tell me the walk through in
creating a script project for WSH?

I made a clean project , and imported one of my .vbs in. Hit F5 to run but
got an error that I should rebuild first. I then did that, but got a compile
error that "Sub main" was not found in "project 1". I then remembered that
you need to tell your project what sub to execute first when running the
program, so I went in to properties but could not understand/find a way to
set it to one of my sub's in my vbs file.

Any takers?
cheers
jk
 
A

Al Dunbar [MS-MVP]

Jacques Koorts said:
Hi there,

I just bought .NET and would like to use it to write my scripts. I only
played about 15 minutes with it trying to see if there is an easy wizard to
create the environment for writing script files for WSH.

Have any of you get this to work? If so can you tell me the walk through in
creating a script project for WSH?

I made a clean project , and imported one of my .vbs in. Hit F5 to run but
got an error that I should rebuild first. I then did that, but got a compile
error that "Sub main" was not found in "project 1". I then remembered that
you need to tell your project what sub to execute first when running the
program, so I went in to properties but could not understand/find a way to
set it to one of my sub's in my vbs file.

If you are wanting to create WSH script projects, why did you get .NET?

/Al
 
J

John Frensen

I just bought .NET and would like to use it to write my scripts.
If you are wanting to create WSH script projects, why did you get .NET?

The question is, can you create a WSH-based project in .NET?
There are lots of reasons to use Visual Studio -- code coloring,
auto-completion of methods, right-click to find definition of a
method, execution of scripts from within the debug environment,
integration with source-code control, etc.

I'm using VS.Net to edit a large collection of WSH JScript and JScript
classes, but to Visual Studio it's just a folder with files. Can
I get VS.Net to do better than this?
 
J

Jeff Cochran

The question is, can you create a WSH-based project in .NET?

No. WSH isn't project based. It's a text shell script.
There are lots of reasons to use Visual Studio -- code coloring,
auto-completion of methods, right-click to find definition of a
method, execution of scripts from within the debug environment,
integration with source-code control, etc.

Most of which don't work in shell scripting with VS.NET, so your
WSH/VBS/Batch file creation makes extremely limited use of VS.NET as
an IDE.
I'm using VS.Net to edit a large collection of WSH JScript and JScript
classes, but to Visual Studio it's just a folder with files. Can
I get VS.Net to do better than this?

Nope. Because it *is* just a folder with files. Currently, the best
IDE for this is PrimalScript.

Jeff
 
G

Gavin Jacobs

Jacques,
There was a way to get part of what you want. See this article:
http://support.microsoft.com/defaul...port/kb/articles/Q249/0/24.ASP&NoWebContent=1

It talks about Visual Interdev, but I think it can be applied to Visual Studio .Net.

You also have to define a custom action for the project to run with WSH. I vaguely recall doing this a year ago, but the result was
the same number of key clicks as starting the script from the command line and with the debug switch.
 

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