Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   JavaScript and Client-Side Browser Scripting (http://www.programmingforums.org/forum23.html)
-   -   Newbie question - Selecting from a choice (http://www.programmingforums.org/showthread.php?t=13096)

pcfixz May 2nd, 2007 6:11 AM

Newbie question - Selecting from a choice
 
Hi,

I am teaching myself vb and am sure this is simple i guess i just need a shove in the right direction.

I am installing a number of network printers which all install fine but what i would like is for a popup box to appear where the user can select the location from say 5 locations.

basically i have say 50 printers in 5 locations. I want to choose the location and then it would install the printers for that location

location a
location b
location c
location d
location e

and then depending on what they selected is would install all the printers from that location?

I am guessing i would some how need to create a variable for each of location?

Below is how i am currently adding the printers but this way i am having to edit the file a lot my suggested way would be that i could add all the printers and then just choose the location

wnet.AddWindowsPrinterConnection "\\server\printername"

Any help you could offer would be greatfully appreicated.

Phil

pcfixz May 2nd, 2007 6:33 AM

sorry this should be in VB script programming could someone move it?

tAK May 3rd, 2007 2:42 AM

For starters, create functions for each location, and a particular locations function contains all of the printers to install for that location.

I am not sure about getting multiple question/selection options from a VB script, i have seen .hta (html applications) that request input, and from what i have seen, they are pretty much just vbs.
http://www.microsoft.com/technet/scr...hubs/htas.mspx

pcfixz May 3rd, 2007 1:42 PM

thanks i will check out .hta

randum77 May 3rd, 2007 2:45 PM

A quick way you could do it is have a *.vbs for each area. Then on a web page make a link to each one? Just a random off the top. I am sure there would be security prompts in doing this.

pcfixz May 3rd, 2007 5:53 PM

the hta will work thats fine. Another simple question i have is if i have a variable called printserver how would i call it would the below be correct?

wnet.AddWindowsPrinterConnection printserver("") & ("\xxx")

printerserver is the server name pulled from a listbox and xxx is the printer name

pcfixz May 5th, 2007 4:51 AM

Quote:

Originally Posted by pcfixz (Post 127459)
the hta will work thats fine. Another simple question i have is if i have a variable called printserver how would i call it would the below be correct?

wnet.AddWindowsPrinterConnection printserver("") & ("\xxx")

printerserver is the server name pulled from a listbox and xxx is the printer name

i fixed the problem in the end

wnet.AddWindowsPrinterConnection (printserver) & "\xxx"


All times are GMT -5. The time now is 2:11 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC