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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
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

    - Introducing Two-Way Data Binding using Silve...
    - Silverlight 2.0 Application Development with...
    - Burning Multisession CDs with IMAPI2 in WSH
    - Creating a Silverlight 2.0 Application that ...
    - Burning CDs with the IMAPI2 Control
    - Burning CDs in Windows XP with WSH
    - Advanced Word Object Scripting
    - Reading and Printing Word Documents in WSH
    - Scripting Microsoft Word
    - Using WSH to Catalog MP3 Files
    - Reading MP3 ID3 Tags in WSH
    - A Brief Look at Menus in WPF
    - More Examples of Simplified Image Processing...
    - Completing a WPF To-Do List Application
    - Simplified Image Processing in GDI+





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT