?
Solved

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

Posted on 2009-05-20
1
Medium Priority
?
175 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month10 days, 20 hours left to enroll

770 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