473,403 Members | 2,323 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,403 software developers and data experts.

Call VBScript From .NET

I have a VBScript that runs on the server. I want to call that script from
an ASP.NET Web application. How can I do that?

Thanks!
Aug 10 '06 #1
16 3712
Hello Jordan S.,

Try this http://msmvps.com/blogs/omar/archive...02/106482.aspx

JI have a VBScript that runs on the server. I want to call that script
Jfrom an ASP.NET Web application. How can I do that?
J>
JThanks!
J>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Aug 10 '06 #2
You can't. VBscript doesn't run on ASP.NET.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Jordan S." <A@B.COMwrote in message news:OJ**************@TK2MSFTNGP06.phx.gbl...
>I have a VBScript that runs on the server. I want to call that script from an ASP.NET Web
application. How can I do that?

Thanks!

Aug 10 '06 #3
Maybe you meant :

System.Diagnostics.Process.Start("script.vbs");

But, it's not really running vbs under ASP.NET, is it ?
It runs it as a different process.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Kevin Spencer" <uc*@ftc.govwrote in message news:eY**************@TK2MSFTNGP06.phx.gbl...
System.Diagnostics.Process.Start("script.vb");

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Accept the Unexpected.

"Jordan S." <A@B.COMwrote in message news:OJ**************@TK2MSFTNGP06.phx.gbl...
>>I have a VBScript that runs on the server. I want to call that script from an ASP.NET Web
application. How can I do that?

Thanks!


Aug 10 '06 #4
Is that example running a VBscript under ASP.NET ?


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Michael Nemtsev" <ne*****@msn.comwrote in message
news:9c**************************@msnews.microsoft .com...
Hello Jordan S.,

Try this http://msmvps.com/blogs/omar/archive...02/106482.aspx

JI have a VBScript that runs on the server. I want to call that script
Jfrom an ASP.NET Web application. How can I do that?
JJThanks!
J---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not cease to be insipid."
(c) Friedrich Nietzsche


Aug 10 '06 #5
Hello Juan,

That example demonstrate approach that OP may undertake

JLIs that example running a VBscript under ASP.NET ?
JL>
JLJuan T. Llibre, asp.net MVP
JLaspnetfaq.com : http://www.aspnetfaq.com/
JLasp.net faq : http://asp.net.do/faq/
JLforos de asp.net, en español : http://asp.net.do/foros/
JL===================================
JL"Michael Nemtsev" <ne*****@msn.comwrote in message
JLnews:9c**************************@msnews.microso ft.com...
>Hello Jordan S.,

Try this http://msmvps.com/blogs/omar/archive...02/106482.aspx

JI have a VBScript that runs on the server. I want to call that
script
Jfrom an ASP.NET Web application. How can I do that?
JJThanks!
J---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents
do not cease to be insipid." (c) Friedrich Nietzsche
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Aug 10 '06 #6
System.Diagnostics.Process.Start("script.vb");

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Accept the Unexpected.

"Jordan S." <A@B.COMwrote in message
news:OJ**************@TK2MSFTNGP06.phx.gbl...
>I have a VBScript that runs on the server. I want to call that script from
an ASP.NET Web application. How can I do that?

Thanks!

Aug 10 '06 #7
RE:

<< You can't. VBscript doesn't run on ASP.NET. >>

What about via COM Interop? Or ???

I can modify the VB script to write a string to a file, then read that file
from the ASP.NET app - but I'd prefer to NOT do it that way. I understand
that VBScript can't be called from .NET as any COM components cannot -
unless COM Interop is brought into the picture. So is COM interop something
that could be used to call a VBScript - or is there some other or easier
way?

Thanks!

Aug 10 '06 #8
RE:
<< That example demonstrate approach that OP may undertake>>

No, it doesn't.
Aug 10 '06 #9
You can run it via WSH...but that's not really "running under ASP.NET".
That's shelling out and running another process.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Jordan S." <A@B.COMwrote in message news:O4**************@TK2MSFTNGP02.phx.gbl...
RE:

<< You can't. VBscript doesn't run on ASP.NET. >>

What about via COM Interop? Or ???

I can modify the VB script to write a string to a file, then read that file from the ASP.NET app -
but I'd prefer to NOT do it that way. I understand that VBScript can't be called from .NET as any
COM components cannot - unless COM Interop is brought into the picture. So is COM interop
something that could be used to call a VBScript - or is there some other or easier way?

Thanks!



Aug 10 '06 #10
Hi Juan,

Yes, "vbs" is correct - I almost never use VBScripts these days.

As for whether it's "really" running under ASP.Net, that was not specified.
That is, whether or not any communication between the script and the ASP.Net
app is necessary. In a case where information such as that is not specified,
I will provide the simplest possible solution, and leave it to the OP to
qualify the issue if necessary. One of my rules of thumb is, avoid
complexity unless it is necessary, and then keep it to a minimum. In this
case, it didn't sound like there needed to be any interaction between the
app and the script. But if so, the OP can point that out.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Accept the Unexpected.

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:ek**************@TK2MSFTNGP05.phx.gbl...
Maybe you meant :

System.Diagnostics.Process.Start("script.vbs");

But, it's not really running vbs under ASP.NET, is it ?
It runs it as a different process.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Kevin Spencer" <uc*@ftc.govwrote in message
news:eY**************@TK2MSFTNGP06.phx.gbl...
>System.Diagnostics.Process.Start("script.vb");

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Accept the Unexpected.

"Jordan S." <A@B.COMwrote in message
news:OJ**************@TK2MSFTNGP06.phx.gbl...
>>>I have a VBScript that runs on the server. I want to call that script
from an ASP.NET Web application. How can I do that?

Thanks!



Aug 10 '06 #11
Hi,

In short no.

But I think you should give us more details about what you want and what you
have.
--
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Jordan S." <A@B.COMwrote in message
news:OJ**************@TK2MSFTNGP06.phx.gbl...
>I have a VBScript that runs on the server. I want to call that script from
an ASP.NET Web application. How can I do that?

Thanks!

Aug 10 '06 #12
RE:
<< But I think you should give us more details about what you want and what
you have. >>

One of my network engineering friends has a VBS script that uses WMI to
determine [which user is connected to a remote machine]. He wants to be able
to run that script and display returned information (user info from remote
machine) via an ASP.NET Web application [page]. While I am familiar with
ASP.NET, I have never attempted to have my ASP.NET Web applications interact
with or use VBScript. My friend said he already has the VBScript ready to
go - so I thought that if there was an easy way to somehow call it and get
its return data into the ASP.NET app, then we might want to go that route.
Same process (direct communication) would be nice - but I could always pipe
the script results to a text file, then read that (but that's rather ugly,
IMO).

Maybe it would be better to translate the WMI logic in the script into
native .NET (perhaps using someting in System.DirectoryServices) and omit
the VBScript altogether.

Any feedback is appreciated.

-Thanks
Aug 10 '06 #13
Hi Jordan,

It is possible to have the "same" WMI script in C#.

Take a look at Classes in the System.Management namespace.
and
http://msdn.microsoft.com/library/de.../using_wmi.asp

HTH.

J.O.

"Jordan S." wrote:
RE:
<< But I think you should give us more details about what you want and what
you have. >>

One of my network engineering friends has a VBS script that uses WMI to
determine [which user is connected to a remote machine]. He wants to be able
to run that script and display returned information (user info from remote
machine) via an ASP.NET Web application [page]. While I am familiar with
ASP.NET, I have never attempted to have my ASP.NET Web applications interact
with or use VBScript. My friend said he already has the VBScript ready to
go - so I thought that if there was an easy way to somehow call it and get
its return data into the ASP.NET app, then we might want to go that route.
Same process (direct communication) would be nice - but I could always pipe
the script results to a text file, then read that (but that's rather ugly,
IMO).

Maybe it would be better to translate the WMI logic in the script into
native .NET (perhaps using someting in System.DirectoryServices) and omit
the VBScript altogether.

Any feedback is appreciated.

-Thanks
Aug 11 '06 #14
Hi,

It is possible to copy-and-paste your WMI code in the C#.

Please take a look on System.Management namespace.

http://msdn.microsoft.com/library/de.../using_wmi.asp

HTH
J.O.

"Jordan S." wrote:
RE:
<< But I think you should give us more details about what you want and what
you have. >>

One of my network engineering friends has a VBS script that uses WMI to
determine [which user is connected to a remote machine]. He wants to be able
to run that script and display returned information (user info from remote
machine) via an ASP.NET Web application [page]. While I am familiar with
ASP.NET, I have never attempted to have my ASP.NET Web applications interact
with or use VBScript. My friend said he already has the VBScript ready to
go - so I thought that if there was an easy way to somehow call it and get
its return data into the ASP.NET app, then we might want to go that route.
Same process (direct communication) would be nice - but I could always pipe
the script results to a text file, then read that (but that's rather ugly,
IMO).

Maybe it would be better to translate the WMI logic in the script into
native .NET (perhaps using someting in System.DirectoryServices) and omit
the VBScript altogether.

Any feedback is appreciated.

-Thanks
Aug 11 '06 #15
re:
It is possible to have the "same" WMI script in C#.
Good point.
Of course, the very same System.Management objects can be accessed with VB.NET, too.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Jurgen_O" <Ju*****@discussions.microsoft.comwrote in message
news:19**********************************@microsof t.com...
Hi Jordan,

It is possible to have the "same" WMI script in C#.

Take a look at Classes in the System.Management namespace.
and
http://msdn.microsoft.com/library/de.../using_wmi.asp

HTH.

J.O.

"Jordan S." wrote:
>RE:
<< But I think you should give us more details about what you want and what
you have. >>

One of my network engineering friends has a VBS script that uses WMI to
determine [which user is connected to a remote machine]. He wants to be able
to run that script and display returned information (user info from remote
machine) via an ASP.NET Web application [page]. While I am familiar with
ASP.NET, I have never attempted to have my ASP.NET Web applications interact
with or use VBScript. My friend said he already has the VBScript ready to
go - so I thought that if there was an easy way to somehow call it and get
its return data into the ASP.NET app, then we might want to go that route.
Same process (direct communication) would be nice - but I could always pipe
the script results to a text file, then read that (but that's rather ugly,
IMO).

Maybe it would be better to translate the WMI logic in the script into
native .NET (perhaps using someting in System.DirectoryServices) and omit
the VBScript altogether.

Any feedback is appreciated.

-Thanks

Aug 11 '06 #16
See the System.Management and System.Management.Instrumentation namespaces.
Chances are, it would be fairly easy to port his VBScript to a part of your
..Net app.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Surgery

Orange you bland I stopped splaying bananas?
"Jordan S." <A@B.COMwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
RE:
<< But I think you should give us more details about what you want and
what you have. >>

One of my network engineering friends has a VBS script that uses WMI to
determine [which user is connected to a remote machine]. He wants to be
able to run that script and display returned information (user info from
remote machine) via an ASP.NET Web application [page]. While I am familiar
with ASP.NET, I have never attempted to have my ASP.NET Web applications
interact with or use VBScript. My friend said he already has the VBScript
ready to go - so I thought that if there was an easy way to somehow call
it and get its return data into the ASP.NET app, then we might want to go
that route. Same process (direct communication) would be nice - but I
could always pipe the script results to a text file, then read that (but
that's rather ugly, IMO).

Maybe it would be better to translate the WMI logic in the script into
native .NET (perhaps using someting in System.DirectoryServices) and omit
the VBScript altogether.

Any feedback is appreciated.

-Thanks

Aug 11 '06 #17

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

Similar topics

1
by: Dustin II. | last post by:
Hi, I have an ASP.NET solution, and the ASPX page I have a form , I want to copy some of the data from that form to the clipboard, I am using the below script the script works fine when I use a...
1
by: SQLReporter | last post by:
Hi, I am trying to access a webservice method from a vbscript. I have a .cs file generated for my webservice. I am not sure how to proceed from this point onwards.... I have tried generating .dll...
3
by: David Shorthouse | last post by:
Hey folks, Not an off-topic posting.....since I was shot-down in an earlier post...this one's legit. How do I go about calling a server-side vbscript within a client-side javascript function?...
2
by: sumGirl | last post by:
Is it possible to use a hyperlink to call a vbs sub? I have seen folks using javascript to do this, but I cannot make it work with vbs and I need to. Please no "you should use javascript"...
4
by: Vadim Vulfov | last post by:
We have DataGrid control and hyperlinkcolumn column type in ASP.NET application. We can successfully trigger javascript function on the hyperlinkcolumn click by using: <asp:HyperLinkColumn...
11
by: rgintexas | last post by:
i'm trying to get server side vbscript to execute in firefox: </script> <script type="text/VBScript" src="VBFile.vbs"> </script> is there any way i can use javascript to call the vbs file, or...
1
by: drec | last post by:
I am just getting my feet wet in php. Is there any way to execute a vbscript file through using a php command? Or in other words, have a php script call a vbs file.
16
by: Jordan S. | last post by:
I have a VBScript that runs on the server. I want to call that script from an ASP.NET Web application. How can I do that? Thanks!
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.