Windows Scripting
  Home arrow Windows Scripting arrow Page 2 - Workarounds for Common Dialogs in WSH
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Workarounds for Common Dialogs in WSH
By: Nilpo/Developer Shed Staff Writer
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2007-04-25

    Table of Contents:
  • Workarounds for Common Dialogs in WSH
  • Useful alternatives
  • The Browse For Folder dialog
  • Using the Browse For Folder dialog

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Workarounds for Common Dialogs in WSH - Useful alternatives


    (Page 2 of 4 )

    You probably remember me stating that the Microsoft’s Common Dialogs control is a licensed control and cannot be used on machines that do not have a Development license installed.  Since most don’t, we’re forced to find a workaround.

    You should also remember me saying that programs created on these machines can use the control.  That’s leaves us one more possible workaround—using a third-party program or control that was developed on a machine with a developer license.

    There are a few of these available.  Most of them are ActiveX controls that work as wrappers.  A wrapper simply takes a request and passes it on to the Common Dialog control on our behalf.

    The down side to this approach is that you will need to distribute the third-party control with your script and it will need to be installed on each machine as well.  Installation is as simple as a service registration, but it’s still a hassle.

    JSWare has released several freeware controls that you may find useful.  Many of them also include a Common Dialogs wrapper.

    In this example, I’m going to use JSWare’s JSDlgBox.dll.  Once you download and register it, you can access it like any other COM object with its ProgID.

    Set objDialogs = CreateObject("JSDlgBox.Browser")

    WScript.Echo objDialogs.OpenBox

    The syntax is very simple.  After connecting to the JSDlgBox object, you only need to call the function for whichever dialog you wish to display.  No parameters are necessary.

    Set objDialogs = CreateObject("JSDlgBox.Browser")

    WScript.Echo objDialogs.SaveBox

    Both functions return empty strings if the user presses the Cancel button, and both also use the standard All Files filter.

    While it is slightly restrictive when it comes to providing control over the dialogs, the JSDlgBox control does provide a very easy method of accessing the Common Dialogs control.

    More Windows Scripting Articles
    More By Nilpo/Developer Shed Staff Writer


       · In the second part of this series I show you some common workarounds for using...
       · This workaround for the common dialogs was very useful, thanks a lot.Don't you...
       · Thanks for reading the article, I'm glad you enjoyed. To answer your question, I...
     

    WINDOWS SCRIPTING ARTICLES

    - More Windows Scripting Workarounds from Nilpo
    - Overloading Methods and More in VBScript
    - Improving MFC for Windows Vista
    - Regular Expressions in VBScript
    - Working with Dates in WMI
    - Completing Calendars with VBScript Date Func...
    - Building Calendars with VBScript Date Functi...
    - Working With Dates and Times in VBScript
    - Designing WCF DataContract Classes Using the...
    - Understanding Dates and Times in VBScript
    - Working With Arrays in VBScript
    - Compressed Folders in WSH
    - Using .NET Interops in VBScript
    - Nilpo`s Scripting Secrets, Vol I
    - Database operations using Silverlight 2.0 WC...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek