Solved

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

Posted on 2009-05-20
1
172 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
1 Comment
 
LVL 5

Accepted Solution

by:
Tompa99 earned 500 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

828 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