Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How do i create a VB application with buttons that will run a vbscript

Posted on 2009-05-20
1
Medium Priority
?
176 Views
Last Modified: 2013-12-26
Ok guys/girls this has probably been answered 1000 times over, but essentially i'm trying to create a gui interface to allow users to simply click a button to install network printers, when they are at different branch offices, e.g. location1 has 10 printers, i want all of those printers at that location mapped, then location2 has 5 printers, i want them mapped too because i'll be going there next month.

i have already got the vbscript files to work using the first two lines of code below

I've designed the form, but the buttons on the form but now i'm stuck at trying to get them to link to the vbscript to run. is this even possible?
I'm using Visual Studio 2008 Sp1, although if need be i can go back to VS 2k5 but shouldn't make a difference really.

I hope this makes sense at what i'm trying to do.
Set WshNetwork = CreateObject("Wscript.Network")
WshNetwork.AddWindowsPrinterConnection "\\%servername%\%printername%

Open in new window

0
Comment
Question by:jpriddle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
Tompa99 earned 2000 total points
ID: 24429582
Hi,

Try this.

        private void button1_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("c:\\vbscript\\test.vbs");
        }

Best Regards Tompa
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question