Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old June 9th, 2003, 05:04 PM
DesertSky DesertSky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: San Antonio, TX
Posts: 5 DesertSky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy I need help with VBscripting!

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!

Reply With Quote
  #2  
Old June 10th, 2003, 03:51 AM
jokre jokre is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Posts: 11 jokre User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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,

Reply With Quote
  #3  
Old June 10th, 2003, 08:22 AM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 4,827 Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level)Onslaught User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 22 h 57 m 29 sec
Reputation Power: 88
Send a message via ICQ to Onslaught
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...

Reply With Quote
  #4  
Old June 10th, 2003, 09:52 AM
DesertSky DesertSky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: San Antonio, TX
Posts: 5 DesertSky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Lightbulb ASP/VB scripting with FSO execution

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!

Reply With Quote
  #5  
Old June 10th, 2003, 10:23 AM
epl epl is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: Dublin
Posts: 413 epl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 18 m 18 sec
Reputation Power: 8
i think you can use the windows scripting host runtime method CreateObject("WScript.Shell").Run( ... )

Reply With Quote
  #6  
Old June 10th, 2003, 02:22 PM
DesertSky DesertSky is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: San Antonio, TX
Posts: 5 DesertSky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > I need help with VBscripting!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

VeriSign Code Signing




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway