|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
VeriSign Code Signing Digital Certificates provides assurance to end users. Read about this and more in the free white paper: “How to Digitally Sign Downloadable Code for Secure Content Transfer.” Learn More! |
|
#1
|
|||
|
|||
|
Hello,
I am a system administrator just beginning to learn VB and ASP scripting. I'm trying to integrate the code with an HTML site I have created for installing printer packages on my network. Bascially, the main page contains a form with a text box where the user enters the name of the printer, and clicks the submit button. This page then calls another ASP page with the code. I have a portion of the code working - when I type in the printer name, and click submit, the querystring returns the value of PrinterName=whatever was typed in the textbox. In this example, say the user has typed in 45-111 as the printer name. I need to append that name with a .pwc extension, then have it search thru a single directory. If it finds 45-111.pwc, I need it to open the file. If it doesn't find 45-111.pwc, I need to issue some type of error (i.e. document.write("Printer " & strPrinterName & " is an invalid printer.") I know that this is pretty elementary stuff for all of you - I'm still trying to learn (but I need to get this script finished!). Any help would be GREATLY appreciated! Thanks! |
|
#2
|
|||
|
|||
|
Hi!
Try using FileSystemObject (FSO) to determine if a file exists in your system. Here's an example on that portion of the code solution: http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=78 This assumes that your file has to be on the web server, but I don't know all of your application prerequisites/requirements. This might also help you out: http://www.w3schools.com/asp/asp_ref_filesystem.asp In what way do you want to "open" the file. Just for display or for editing purposes? Regards, |
|
#3
|
||||
|
||||
|
In the future please use a more appropriate subject title. Follow the link in the sticky at the top of this forum for more information on how to post.
Thanks, and welcome to the community... |
|
#4
|
|||
|
|||
|
Jokre, thanks for the URLs - they were very helpful. I'm going to delve back into working on my ASP page today.
To answer your question, it probably would have been better if I had said execute rather than open. The .PWC files are prism package files that launch the installation of applications (or in this case, printers) on workstations with the prism client installed. Thanks again for your help! -DesertSky Onslaught: my apologies on the thread subject...it was not my intention to annoy the moderator on the very first post! ![]() |
|
#5
|
|||
|
|||
|
i think you can use the windows scripting host runtime method CreateObject("WScript.Shell").Run( ... )
|
|
#6
|
|||
|
|||
|
Thanks for the help - the page is working now.
BUT, I am having problems pointing the server.mapPath to a directory outside of the ASP page's home directory. I've detailed the problem on the ASP discussion board at:http://forums.devshed.com/t64840/s.html If anyone can offer their expertise, I'd appreciate it! Thanks! ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > I need help with VBscripting! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|