<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>KR Testing Solutions</title>
	<atom:link href="http://kuldeepse.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kuldeepse.wordpress.com</link>
	<description>Quality is effected by your work process</description>
	<lastBuildDate>Fri, 27 Jan 2012 04:43:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='kuldeepse.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/90d0e1d9a7b5ada4b0de3575cdda4566?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>KR Testing Solutions</title>
		<link>http://kuldeepse.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://kuldeepse.wordpress.com/osd.xml" title="KR Testing Solutions" />
	<atom:link rel='hub' href='http://kuldeepse.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Your opinion</title>
		<link>http://kuldeepse.wordpress.com/2011/10/04/your-opinion/</link>
		<comments>http://kuldeepse.wordpress.com/2011/10/04/your-opinion/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 08:38:39 +0000</pubDate>
		<dc:creator>kuldeep kumar</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kuldeepse.wordpress.com/?p=209</guid>
		<description><![CDATA[Filed under: Uncategorized<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=209&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<a href="http://polldaddy.com/poll/5555964">Take Our Poll</a>
<br />Filed under: <a href='http://kuldeepse.wordpress.com/category/uncategorized/'>Uncategorized</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuldeepse.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuldeepse.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kuldeepse.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kuldeepse.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kuldeepse.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kuldeepse.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kuldeepse.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kuldeepse.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kuldeepse.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kuldeepse.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kuldeepse.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kuldeepse.wordpress.com/209/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kuldeepse.wordpress.com/209/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kuldeepse.wordpress.com/209/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=209&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuldeepse.wordpress.com/2011/10/04/your-opinion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>35.487000 -80.860000</georss:point>
		<geo:lat>35.487000</geo:lat>
		<geo:long>-80.860000</geo:long>
		<media:content url="http://1.gravatar.com/avatar/b37d5959686c283f564079068ff8246f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kuldeep</media:title>
		</media:content>
	</item>
		<item>
		<title>QTP 11</title>
		<link>http://kuldeepse.wordpress.com/2011/08/31/qtp-11/</link>
		<comments>http://kuldeepse.wordpress.com/2011/08/31/qtp-11/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 05:49:04 +0000</pubDate>
		<dc:creator>kuldeep kumar</dc:creator>
				<category><![CDATA[Quick Test Professional]]></category>

		<guid isPermaLink="false">http://kuldeepse.wordpress.com/?p=201</guid>
		<description><![CDATA[QTP 11 Offers following new features 1. Manage Your Test Data 2. Test Your GUI and UI-Less Application Functionality in One Test 3. New Run Results Viewer 4. Help QuickTest Identify Your Objects as a Manual Tester Would – VISUALLY 5.  Collaborate with Developers to Pinpoint Defects Using Log Tracking 6.  Out-of-the-Box Support for Web [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=201&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2><span style="text-decoration:underline;">QTP 11 Offers following new features</span></h2>
<p>1. Manage Your Test Data</p>
<p><em>2. </em>Test Your GUI and UI-Less Application Functionality in One Test</p>
<p>3. New Run Results Viewer</p>
<p>4. Help QuickTest Identify Your Objects as a Manual Tester Would – VISUALLY</p>
<p>5.  Collaborate with Developers to Pinpoint Defects Using Log Tracking</p>
<p>6.  Out-of-the-Box Support for Web 2.0 Toolkit Applications</p>
<p>7.  New Web Testing Capabilities</p>
<p>8.  Automatically Parameterize Steps</p>
<p>9.  New Silverlight Add-in</p>
<p>10.Extend WPF and Silverlight Support</p>
<p>11. Use Extensibility Accelerator for Web Add-in Extensibility Development</p>
<p>12. It’s Easier Than Ever to Insert Regular Expressions</p>
<p>13. Load Function Libraries at Run Time</p>
<p>14. Avoid Downtime Due to License Server Failures</p>
<p>15. Improved Documentation Structure Helps You Find the Information You Need</p>
<p>&nbsp;</p>
<p><strong>Manage Your Test Data</strong></p>
<p>Quality Center (HP ALM) test configuration functionality enables you to determine at runtime which data sets to use for your tests.</p>
<p>ALM test configurations enable you to:</p>
<p><strong>Unbind your data from your tests</strong></p>
<p><strong>Share common data sources across different tests</strong></p>
<p><strong>Filter your data to fit your testing needs</strong></p>
<p><strong>Increase requirements traceability</strong></p>
<p>You store the data for your tests in the Quality Center <strong>Test Resources</strong> module in the form of data table resource files.</p>
<p>You can then define multiple test <em>configurations </em>for a test in the <strong>Test Plan </strong>module. When working with data-driven QuickTest tests in HP ALM, each <strong>configuration</strong> is a QuickTest test that is set to run with a selected data resource file and optional data filter settings.</p>
<p>One or more specific configurations of the test can be included in a Test Set to cover different parts of a requirement or to cover multiple requirements.</p>
<p>By using Quality Center test configurations, you can create more generic tests and reuse them by associating a different set of data with each. You can also reuse your data by associating the same data table file with multiple tests.</p>
<p><strong>Test Your GUI and UI-Less Application Functionality in One Test</strong></p>
<p>The new QuickTest-Service Test integration enables you to test across the GUI and non-GUI layers of your application.</p>
<p>You can use QuickTest steps to start testing the GUI elements in your application, then call a Service Test test to validate service communications (standard Web Services, non-SOAP Web Services, such as REST, etc.), and then step back into your QuickTest GUI testing, all in a single test run.</p>
<p>The results of the QuickTest and Service Test steps are displayed in a unified report in the new Run Results Viewer.</p>
<p><strong>New Run Results Viewer</strong></p>
<p>The new Run Results Viewer provides an Executive Summary page with summary data, pie charts and statistics for both the current and previous runs, a quick link to the previous run results, and more.</p>
<p>The Run Results Viewer displays the results of your run session in a set of panes that you can show, hide, move, dock, and otherwise customize to your needs.</p>
<p>You can install the Run Results Viewer as a standalone installation. This enables you to share the results of your tests with business analysts and developers who do not work with QuickTest.</p>
<p><strong>Help QuickTest Identify Your Objects as a Manual Tester Would – VISUALLY</strong></p>
<p>You can now use visual relation identifiers to identify application objects based on other objects that are always near them.</p>
<p>This enables you to create a more reliable identification definition for test objects that are otherwise difficult to differentiate, and to ensure that the identification remains reliable even if the user interface design changes.The Visual Relation Identifier Dialog Box provides the interface and tools to help you create and verify your visual relation identifier definitions.</p>
<p><strong>Collaborate with Developers to Pinpoint Defects Using Log Tracking</strong></p>
<p>In today’s more agile development environment, it is more important than ever for QA engineers and developers to work together throughout the development and release process.</p>
<p>QuickTest’s new <strong>Log Tracking</strong> functionality helps you work with developers to pinpoint the root causes of unexpected behavior in your application.</p>
<p>When you enable log tracking, QuickTest receives the Java or .NET log framework messages from your application and embeds them in the run results.</p>
<p>You can click a log message in the results to jump to the relevant step in the run results tree, or you can click a step in the run results tree and view the log message that was generated at the time that the selected step ran. You can also specify that a log message of a particular level (or higher) will fail your test.</p>
<p>After you view the results, you can print or export the log tracking details to a file to show to a developer, or you can provide the developer with the standalone Run Results Viewer installation so that the developer can view and analyze the results directly on his or her own desktop.</p>
<p><strong>Out-of-the-Box Support for Web 2.0 Toolkit Applications</strong></p>
<p>QuickTest 11.00 provides Web Add-in Extensibility-based add-ins for ASP .NET Ajax, GWT, Yahoo UI, and Dojo Web 2.0 toolkits.</p>
<p>You can use these add-ins just as you would any other add-in. You can also use Web Add-in Extensibility or Extensibility Accelerator to customize the provided support to match your needs.</p>
<p>You install these add-ins by running the Web 2.0 Toolkit Support Setup from the Add-in Extensibility and Web 2.0 Toolkits option in the QuickTest Professional setup window.</p>
<p>The operations supported for each Web 2.0 test object class are a combination of custom operations developed for that test object class and operations directly inherited from the corresponding (base) Web Add-in test object class.</p>
<p><strong>New Web Testing Capabilities</strong></p>
<p>Many new testing capabilities are now available for working with Web-Based objects.</p>
<p><strong><span style="text-decoration:underline;">Firefo Testing :</span></strong>You can now record steps on Mozilla Firefox and use the <strong>.Object</strong> property to access the Firefox DOM.</p>
<p><strong><span style="text-decoration:underline;">XPath,CSS,Identifiers:</span></strong> You can add the XPath or CSS identifier properties to instruct QuickTest to identify a Web object in your application based on its XPath location or CSS definition.</p>
<p><strong><span style="text-decoration:underline;">Event Identifiers:</span></strong>You can also now use the attribute/* notation in the test object description to identify a Web-based object based on an event associated with that object. For example, you can add attribute/onClick as a property in a WebButton test object description to identify a button that is associated with the onClick event.</p>
<p>Embed or Run JavaScripts in Your Web Pages. You can use the new <strong><span style="text-decoration:underline;"> EmbedScript/EmbedScriptFromFile</span></strong> and <strong><span style="text-decoration:underline;">RunScript/RunScriptFromFile</span></strong> functions to embed JavaScripts in all loaded browser pages and frames or to run JavaScripts in specific pages. Use these scripts to perform operations on, or retrieve data from, the browser pages in your application.</p>
<p><strong>Automatically Parameterize Steps</strong></p>
<p>You can instruct QuickTest to automatically parameterize the steps in your test’s actions at the end of a recording session.</p>
<p>This enables you to create actions that can be used for a variety of different purposes or scenarios by referencing different sets of data.</p>
<p>You activate this option by selecting the <strong>Automatically parameterize steps</strong> option in the General tab of the Options dialog box. You can set the option to use <strong>Global Data Table Parameters</strong> or <strong>Test Parameters</strong>.</p>
<p>When you stop a recording session while this option is selected, QuickTest replaces the constant values in the test object operation arguments of your steps with either Data Table parameters or action parameters, based on your selection in the Options dialog box.</p>
<p>QuickTest performs this automatic parameterization for all relevant steps in any action in your test, in which you recorded one or more steps during that recording session.</p>
<p>If you work with HP ALM, and you select the <strong>Global Data Table Parameters</strong> option, you can map the generated parameters to the column names of a data resource and then use different configurations in your test sets.</p>
<p>If you work with SAP eCATT and you select the <strong>Test Parameters </strong>option, you can then supply the values for the test parameters from eCATT.</p>
<p><strong>New Silverlight Add-in</strong></p>
<p>You can use the new Silverlight Add-in to test objects in Silverlight 2 and Silverlight 3 applications.</p>
<p>After you install the Silverlight Add-in, it is displayed in the Add-in Manager as a child add-in under the WPF Add-in.</p>
<p><strong>Extend WPF and Silverlight Support</strong></p>
<p>The WPF and Silverlight Add-in Extensibility SDK enables you to develop support for testing third-party and custom WPF and Silverlight controls that are not supported out-of-the-box by the relevant QuickTest add-ins.You install the WPF and Silverlight Add-in Extensibility SDK from the Add-in Extensibility and Web 2.0 Toolkits option in the QuickTest Professional setup window.</p>
<p><strong>Use Extensibility Accelerator for Web Add-in Extensibility Development</strong></p>
<p>The new Extensibility Accelerator for Functional Testing is a Visual Studio-like IDE that facilitates the design, development, and deployment of Web Add-in Extensibility support.</p>
<p>It provides a user interface and special tools that help you define new test object classes, map those test object classes to the controls in your application, and teach QuickTest how to identify the controls, perform operations on the controls and retrieve their properties.You install the Extensibility Accelerator from the Add-in Extensibility and Web 2.0 Toolkits option in the QuickTest Professional setup window.</p>
<p><strong>It’s Easier Than Ever to Insert Regular Expressions</strong></p>
<p>The Smart Regular Expression list provides syntax hints that make it easier than ever to insert regular expressions into your test steps. It also enables you to access the Regular Expression Evaluator, which lets you test regular expressions to make sure they suit your needs.</p>
<p><strong>Load Function Libraries at Run Time</strong></p>
<p>The new <strong>LoadFunctionLibrary</strong> statement lets you load a function library when a step runs instead of at the beginning of a run session. This means, for example, that you can define conditional steps that use functions from various function libraries, but load only the required function libraries during a run session.</p>
<p><strong>Avoid Downtime Due to License Server Failures</strong></p>
<p>With <strong>redundant license servers</strong> you create failover, so that if your main license server fails, your remaining servers maintain availability of your licenses without causing any downtime or loss of licenses for users.The redundant license server feature is especially useful for enterprise customers who have a large network installation and want to maintain license server backup.</p>
<p><strong>Improved Documentation Structure Helps You Find the Information You Need</strong></p>
<p>When you open the QuickTest Professional Help, you can now access the entire Documentation Library from one central point, the <strong>Home</strong> page. It provides links to all available guides in each available format, including PDF files.</p>
<p>The HP QuickTest Professional User Guide and the HP QuickTest Professional for Business Process Testing User Guide are now organized into topic types: <strong>Concepts</strong>, <strong>Tasks</strong>, and <strong>References</strong>. Use each topic type to access specific information about a feature or product area.</p>
<p>For example, you can use the <strong>Tasks</strong> topic type to learn the overall workflow of a feature to help you accomplish your goals, or you can use the <strong>Reference</strong> topic type to look up a specific user interface element, such as a window, dialog box, or page.</p>
<br />Filed under: <a href='http://kuldeepse.wordpress.com/category/quick-test-professional/'>Quick Test Professional</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuldeepse.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuldeepse.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kuldeepse.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kuldeepse.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kuldeepse.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kuldeepse.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kuldeepse.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kuldeepse.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kuldeepse.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kuldeepse.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kuldeepse.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kuldeepse.wordpress.com/201/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kuldeepse.wordpress.com/201/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kuldeepse.wordpress.com/201/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=201&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuldeepse.wordpress.com/2011/08/31/qtp-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b37d5959686c283f564079068ff8246f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kuldeep</media:title>
		</media:content>
	</item>
		<item>
		<title>QTP 9.5 vs QTP 10 vs QTP 11</title>
		<link>http://kuldeepse.wordpress.com/2011/08/31/qtp-9-5-vs-qtp-10-vs-qtp-11/</link>
		<comments>http://kuldeepse.wordpress.com/2011/08/31/qtp-9-5-vs-qtp-10-vs-qtp-11/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 05:45:23 +0000</pubDate>
		<dc:creator>kuldeep kumar</dc:creator>
				<category><![CDATA[Quick Test Professional]]></category>

		<guid isPermaLink="false">http://kuldeepse.wordpress.com/?p=198</guid>
		<description><![CDATA[QTP 10 vs QTP 11 QTP 10 and QTP 11  are two versions of the Quick Test Professional (QTP), which is a testing tool to judge the proficiency of individuals in functional Graphic User Interface. It helps in testing a lot of topics such as standard windows applications, web objects, Active X controls, .Net, Java, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=198&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>QTP 10 vs QTP 11</strong></p>
<p><strong>QTP 10 and QTP 11 </strong> are two versions of the Quick Test Professional (QTP), which is a testing tool to judge the proficiency of individuals in functional Graphic User Interface. It helps in testing a lot of topics such as standard windows <a title="applications" href="http://www.differencebetween.com/category/technology/it/applications/">applications</a>, web objects, Active X controls, .Net, Java, SAP, visual basic <a title="applications" href="http://www.differencebetween.com/category/technology/electronics/smart-phones/applications-smart-phones/">applications</a>, Siebel, Oracle, PeopleSoft, and terminal emulators. QTP is Unicode compliant according to the requirements of Unicode standard. This enables testing applications in many languages.</p>
<p>So far there have been many versions of QTP and with the arrival of QTP11, there are many who are confused about the differences between QTP11 and QTP10. Of course there are many updates as well as totally new features in QTP11 that were not there in QTP10.</p>
<p>While<strong> QTP10</strong> was able to identify object through only normal object identification, there are different ways to identify an object in QTP11. These different methods are XPath tutorial and CSS tutorial.</p>
<p>In <strong>QTP11,</strong> results viewer have been improved in the form of pie charts, statics for both current and previous test runs and summary page.</p>
<p>Normal object identification method has been slightly changed in QTP11. There is a visual relation identifier in addition to ordinal identifier. In this, object identification will depend upon relation to neighboring objects and will be helpful to overcome weakness of ordinal identification feature that was there in QTP10.</p>
<p>There is a new LoadFunctionLibrary in QTP11 that is very helpful to load function library at any step instead of starting of run.</p>
<p>In comparison to QTP10, regular expression creation is very easy in QTP11.</p>
<p>It is possible to test GUI and UI-less application functionality which was not possible in QTP10.</p>
<p>There is a totally new Silverlight add on that supports to test objects in silverlight 2 and silverlight 3. Another new feature that has been added in QTP is automatic parameterize steps.</p>
<p><strong>QTP 9.5 vs QTP 10</strong></p>
<p>QTP 9.5 and QTP 10 are software testing <a title="tools" href="http://www.differencebetween.com/category/home/tools/">tools</a>.  QTP means QuickTest Professional. QTP is an automated testing tool developed by HP/Mercury. This tool integrates with other testing solutions such as LoadRunner, WinRunner and TestDirector/Quality Center. One of the versions of this testing tool is QTP 9.5 and QTP 10. QTP 10 has added features as compared to the previous version.</p>
<p><strong>QTP 9.5</strong></p>
<p>The version 9.5 of QuickTest Professional tool provides following added features over the last versions:</p>
<p>• <strong>Process Guidance</strong> – The help files are more accessible this time. This is good when a user is learning to record the test for the first time.</p>
<p>• <strong>Maintenance Run Mode</strong> – Now, users can update object properties and add steps to them on the fly. Users just need to run the maintenance mode if there is some change in the object properties after new build is made.</p>
<p>• <strong>Tabbed Browsing</strong> – Separate browsers identify the tabs. The same test is compatible with tabbed as well as non-tabbed browsers.</p>
<p>• <strong>New environments</strong> – This version supports new environments such as Firefox 3.0, Windows Vista, Record on SWT, Netscape 9 and Eclipse 3.2 and 3.3.</p>
<p>All the add-in can be integrated with the core package that is installed on the system. However, these add-ins need to be activated and for this, users need to buy them separately. Another enhancement to this version is that users are now able to view the functions that are related to current tests. Other added functionality provided by QTP 9.5 is bitmap checkpoint and Web add-in extensibility.</p>
<p><strong>QTP 10</strong></p>
<p>This version of QuickTest Professional provides integration capabilities of new quality center 10.00. Some of the capabilities are:</p>
<p>• Support for baselines and asset versioning.</p>
<p>• A new dependencies and resources model for storing as well as managing shared assets.</p>
<p>• It also provides a special tool for Quality center administrators that help in upgrading all the assets of QuickTest to be used with new features. The assets include application areas, <a title="components" href="http://www.differencebetween.com/category/technology/electronics/components/">components</a>, recovery scenarios, function libraries, tests, and external data tables and shared object repositories.</p>
<p>• There is an Asset comparison tool included in this version that allows the comparison of versions of assets.</p>
<p>The Local system monitoring tool provided in this version helps you in monitoring the computer’s resources that are used by application instance that you are testing during a session.</p>
<div align="center">
<table width="612" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="612"><strong>Difference between QTP 9.5 and QTP 10</strong>:</p>
<p>• In QTP 10, the test results can be exported in formats such as PDF, Doc, and HTML whereas this is not possible in QTP 9.5.</p>
<p>• All resources can be saved at one place only in version 10.</p>
<p>• While monitoring, the type of variable can also be viewed in QTP 10.</td>
</tr>
</tbody>
</table>
</div>
<br />Filed under: <a href='http://kuldeepse.wordpress.com/category/quick-test-professional/'>Quick Test Professional</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuldeepse.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuldeepse.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kuldeepse.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kuldeepse.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kuldeepse.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kuldeepse.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kuldeepse.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kuldeepse.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kuldeepse.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kuldeepse.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kuldeepse.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kuldeepse.wordpress.com/198/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kuldeepse.wordpress.com/198/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kuldeepse.wordpress.com/198/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=198&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuldeepse.wordpress.com/2011/08/31/qtp-9-5-vs-qtp-10-vs-qtp-11/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b37d5959686c283f564079068ff8246f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kuldeep</media:title>
		</media:content>
	</item>
		<item>
		<title>Steps for learning Descriptive programming</title>
		<link>http://kuldeepse.wordpress.com/2008/02/05/steps-for-learning-descriptive-programming/</link>
		<comments>http://kuldeepse.wordpress.com/2008/02/05/steps-for-learning-descriptive-programming/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 12:55:25 +0000</pubDate>
		<dc:creator>kuldeep kumar</dc:creator>
				<category><![CDATA[Learn VBScript for QTP (Descriptive Programming)]]></category>

		<guid isPermaLink="false">http://kuldeepse.wordpress.com/2008/02/05/steps-for-learning-descriptive-programming/</guid>
		<description><![CDATA[Learning VBScript for QTP We can learn the VBScript without QTP also. You need Notepad and command prompt on your system and follow below steps: Create a notepad file. Write a small VBScript in the notepad file. e.g.  Option Explicit  Dim myResponse  myResponse = MsgBox(&#8220;Do you wish to quit?&#8221;, 1, &#8220;What do you wish to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=126&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-size:10pt;font-family:Verdana;">Learning VBScript for QTP</span></strong><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p><span style="font-size:10pt;font-family:Verdana;">We can learn the VBScript without QTP also. You need Notepad and command prompt on your system and follow below steps:</span><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<ol>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Create a notepad file.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Write a small VBScript in the notepad file.</span></li>
</ol>
<p><strong><span style="font-size:10pt;font-family:Verdana;">e.g. </span></strong></p>
<p><strong> </strong><strong><span style="font-size:10pt;font-family:Verdana;">Option Explicit</span></strong><br />
<strong> </strong><strong><span style="font-size:10pt;font-family:Verdana;">Dim myResponse</span></strong><br />
<strong> </strong><strong><span style="font-size:10pt;font-family:Verdana;">myResponse = MsgBox(&#8220;Do you wish to quit?&#8221;, 1, &#8220;What do you wish </span></strong><strong><span style="font-size:10pt;font-family:Verdana;">to do?&#8221;)</span></strong><strong><span style="font-size:10pt;font-family:Verdana;"> </span></strong></p>
<ol>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Save the above Notepad file as Test.vbs.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Run above file from the command prompt using CScript.exe.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">C:\&gt;CScript.exe Test.vbs</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">You will be getting the result of your script.</span></li>
</ol>
<p><span style="font-size:10pt;font-family:Verdana;"><strong><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">Descriptive programming in QTP </span></strong></span><br />
<span style="font-size:10pt;font-family:Verdana;"><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">Whenever QTP records any action on any object of an application, it adds some description on how to recognize that object to a repository of objects called object repository. QTP cannot take action on an object until unless its object description is in the Object Repository. But descriptive programming provides a way to perform action on objects which are not in Object repository</span></span><br />
<span style="font-size:10pt;font-family:Verdana;"><br />
<span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>Object Identification:</strong><br />
To identify an object during the play back of the scripts QTP stores some properties which helps QTP to uniquely identify the object on a page. Below screen shots shows an example Object repository:</span></span><span style="font-size:10pt;font-family:Verdana;"><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">Now to recognize a radio button on a page QTP had added 2 properties the name of the radio button and the html tag for it. The name the left tree view is the logical name given by QTP for the object. This can be changed as per the convenience of the person writing the test case. QTP only allows UNIQUE logical name under same level of hierarchy. As we see in the snapshot the two objects in Browser-&gt;Page node are “WebTable” and “testPath”, they cannot have the same logical name. But an object under some other node can have the same name. Now with the current repository that we have, we can only write operation on objects which are in the repository. Some of the example operations are given below</span></span><br />
<span style="font-size:10pt;font-family:Verdana;"><br />
<span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>Browser(&#8220;Browser&#8221;).Page(&#8220;Page&#8221;).WebRadioGroup (&#8220;testPath&#8221;).Select &#8220;2&#8243;<br />
cellData = Browser(&#8220;Browser&#8221;).Page(&#8220;Page&#8221;).WebTable (&#8220;WebTable&#8221;).GetCellData (1,1)<br />
Browser(&#8220;Example2&#8243;).Page(&#8220;Page&#8221;).WebEdit(&#8220;testPath&#8221;).Set &#8220;Test text&#8221;</strong> </span><strong><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">When and </span></strong></span><br />
<span style="font-size:10pt;font-family:Verdana;"><br />
<strong><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">Why to use Descriptive programming? </span></strong></span><br />
<span style="font-size:10pt;font-family:Verdana;"><strong> </strong><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">Below are some of the situations when Descriptive Programming can be considered useful:<br />
The objects in the application are dynamic in nature and need special handling to identify the object. The best example would be of clicking a link which changes according to the user of the application, Ex. “Logout &lt;&lt;UserName&gt;&gt;”.<br />
When object repository is getting huge due to the no. of objects being added. If the size of Object repository increases too much then it decreases the performance of QTP while recognizing a object.<br />
When you don’t want to use object repository at all. Well the first question would be why not Object repository? Consider the following scenario which would help understand why not Object repository</span></span></p>
<p><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>Scenario 1:</strong> Suppose we have a web application that has not been developed yet. Now QTP for recording the script and adding the objects to repository needs the application to be up, that would mean waiting for the application to be deployed before we can start of with making QTP scripts. But if we know the descriptions of the objects that will be created then we can still start off with the script writing for testing</span></p>
<p><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>Scenario 2:</strong> Suppose an application has 3 navigation buttons on each and every page. Let the buttons be “Cancel”, “Back” and “Next”. Now recording action on these buttons would add 3 objects per page in the repository. For a 10 page flow this would mean 30 objects which could have been represented just by using 3 objects. So instead of adding these 30 objects to the repository we can just write 3 descriptions for the object and use it on any page.</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">Modification to a test case is needed but the Object repository for the same is Read only or in shared mode i.e. changes may affect other scripts as well.</span><br />
<span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">When you want to take action on similar type of object i.e. suppose we have 20 textboxes on the page and there names are in the form txt_1, txt_2, txt_3 and so on. Now adding all 20 the Object repository would not be a good programming approach. </span></p>
<p><strong><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">How to use Descriptive programming? </span></strong></p>
<p><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">There are two ways in which descriptive programming can be used<br />
By creating properties collection object for the description.<br />
By giving the description in form of the string arguments.</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">By creating properties collection object for the description.</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">To use this method you need first to create an empty description</span><br />
<span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><br />
<strong>Dim obj_Desc ‘Not necessary to declare<br />
Set obj_Desc = Description.Create<br />
</strong><br />
Now we have a blank description in “obj_Desc”. Each description has 3 properties “Name”, “Value” and “Regular Expression”.</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"> </span></p>
<p><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>obj_Desc(“html tag”).value= “INPUT”<br />
</strong><br />
When you use a property name for the first time the property is added to the collection and when you use it again the property is modified. By default each property that is defined is a regular expression. Suppose if we have the following description</span></p>
<p><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>obj_Desc(“html tag”).value= “INPUT<br />
” obj_Desc(“name”).value= “txt.*”<br />
</strong><br />
This would mean an object with html tag as INPUT and name starting with txt. Now actually that “.*” was considered as regular expression. So, if you want the property “name” not to be recognized as a regular expression then you need to set the “regularexpression” property as FALSE</span></p>
<p><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>obj_Desc(“html tag”).value= “INPUT”<br />
obj_Desc(“name”).value= “txt.*”<br />
obj_Desc(“name”).regularexpression= “txt.*”<br />
</strong><br />
This is how of we create a description. Now below is the way we can use it</span></p>
<p><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test”<br />
</strong><br />
When we say .WebEdit(obj_Desc) we define one more property for our description that was not earlier defined that is it’s a text box (because QTPs WebEdit boxes map to text boxes in a web page).</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">If we know that we have more than 1 element with same description on the page then we must define “index” property for the that description</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">Consider the HTML code given below</span></p>
<p><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>&lt;INPUT type=”textbox” name=”txt_Name”&gt;<br />
&lt;INPUT type=”textbox” name=”txt_Name”&gt;<br />
</strong><br />
Now the html code has two objects with same description. So distinguish between these 2 objects we will use the “index” property. Here is the description for both the object</span></p>
<p><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>For 1st textbox:<br />
obj_Desc(“html tag”).value= “INPUT”<br />
obj_Desc(“name”).value= “txt_Name<br />
” obj_Desc(“index”).value= “0”<br />
</strong><br />
<strong>For 2nd textbox:<br />
obj_Desc(“html tag”).value= “INPUT”<br />
obj_Desc(“name”).value= “txt_Name”<br />
obj_Desc(“index”).value= “1”<br />
</strong><br />
Consider the HTML Code given below:</span></p>
<p><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>&lt;INPUT type=”textbox” name=”txt_Name”&gt;<br />
&lt;INPUT type=”radio” name=”txt_Name”&gt;</strong></span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"> </span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">We can use the same description for both the objects and still distinguish between both of them</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>obj_Desc(“html tag”).value= “INPUT”<br />
obj_Desc(“name”).value= “txt_Name”<br />
</strong><br />
When I want to refer to the textbox then I will use the inside a WebEdit object and to refer to the radio button I will use the description object with the WebRadioGroup object.</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test” ‘Refers to the text box<br />
Browser(“Browser”).Page(“Page”).WebRadioGroup(obj_Desc).set “Test” ‘Refers to the radio button<br />
</strong><br />
But if we use WebElement object for the description then we must define the “index” property because for a webelement the current description would return two objects.<br />
<strong><br />
Hierarchy of test description:</strong><br />
When using programmatic descriptions from a specific point within a test object hierarchy, you must continue to use programmatic descriptions from that point onward within the same statement. If you specify a test object by its object repository name after other objects in the hierarchy have been described using programmatic descriptions, QuickTest cannot identify the object.</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">For example, you can use <strong>Browser(Desc1).Page(Desc1).Link(desc3),</strong> since it uses programmatic descriptions throughout the entire test object hierarchy. You can also use <strong>Browser(&#8220;Index&#8221;).Page(Desc1).Link(desc3),</strong> since it uses programmatic descriptions from a certain point in the description (starting from the Page object description).</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">However, you cannot use Browser(Desc1).Page(Desc1).Link(&#8220;Example1&#8243;), since it uses programmatic descriptions for the Browser and Page objects but then attempts to use an object repository name for the Link test object (QuickTest tries to locate the Link object based on its name, but cannot locate it in the repository because the parent objects were specified using programmatic descriptions).</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>Getting Child Object:</strong><br />
We can use description object to get all the objects on the page that matches that specific description. Suppose we have to check all the checkboxes present on a web page. So we will first create an object description for a checkboxe and then get all the checkboxes from the page</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>Dim obj_ChkDesc<br />
Set obj_ChkDesc=Description.Create<br />
obj_ChkDesc(“html tag”).value = “INPUT”<br />
obj_ChkDesc(“type”).value = “checkbox”<br />
</strong><br />
<strong>Dim allCheckboxes, singleCheckBox<br />
Set allCheckboxes = Browse(“Browser”).Page(“Page”).ChildObjects(obj_ChkDesc)</strong><br />
<span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;">For each singleCheckBox in allCheckboxes</span></span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>singleCheckBox.Set “ON”<br />
</strong><br />
Next<br />
The above code will check all the check boxes present on the page. To get all the child objects we need to specify an object description i.e. we can’t use the string arguments that will be discussed later in the 2nd way of using the programming description.</span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"><strong>Possible Operation on Description Object</strong></span><span style="font-size:10pt;color:black;line-height:150%;font-family:Verdana;"> Consider the below code for all the solutions<br />
<strong>Dim obj_ChkDesc</strong><strong> Set obj_ChkDesc=Description.Create<br />
obj_ChkDesc(“html tag”).value = “INPUT”<br />
obj_ChkDesc(“type”).value = “checkbox” </strong></span></span></p>
<p><a href="http://kuldeepse.wordpress.com/2008/02/04/1-declaring-variables/"><span style="color:#000044;">Next Step &#8211; Variable Declaration</span></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kuldeepse.wordpress.com/126/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kuldeepse.wordpress.com/126/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuldeepse.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuldeepse.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kuldeepse.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kuldeepse.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kuldeepse.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kuldeepse.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kuldeepse.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kuldeepse.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kuldeepse.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kuldeepse.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kuldeepse.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kuldeepse.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kuldeepse.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kuldeepse.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=126&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuldeepse.wordpress.com/2008/02/05/steps-for-learning-descriptive-programming/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b37d5959686c283f564079068ff8246f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kuldeep</media:title>
		</media:content>
	</item>
		<item>
		<title>10: FileSystemObject</title>
		<link>http://kuldeepse.wordpress.com/2008/02/05/10-filesystemobject/</link>
		<comments>http://kuldeepse.wordpress.com/2008/02/05/10-filesystemobject/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 11:49:47 +0000</pubDate>
		<dc:creator>kuldeep kumar</dc:creator>
				<category><![CDATA[Learn VBScript for QTP (Descriptive Programming)]]></category>

		<guid isPermaLink="false">http://kuldeepse.wordpress.com/?p=125</guid>
		<description><![CDATA[Managing Files and Folders As you have already seen this afternoon the FileSystemObject is actually fairly easy to work with. All that you have to do is establish an instance of it and you can start using its properties and methods. In the sections that follow you’ll see examples of how to use this object [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=125&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-size:10pt;font-family:Verdana;">Managing Files and Folders </span></strong><br />
<span style="font-family:Verdana;"><font size="2">As you have already seen this afternoon the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> is actually fairly easy to work with. All that you have to do is establish an instance of it and you can start using its properties and methods. In the sections that follow you’ll see examples of how to use this object to create, copy, move, and delete files and folders.</font></span><br />
<strong><span style="font-size:10pt;font-family:Verdana;">Copying Files</span></strong><br />
<span style="font-family:Verdana;"><font size="2">Using the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">CopyFile()</span></span> method you can copy one or more files. For example, you might want to copy all the files in the folder on your computer to a network drive at the end of each day. I’ll show you how to work with network drives this evening. For now let’s just focus on how the <span class="fixed1"><span style="font-family:Verdana;">CopyFile()</span></span> method works.</font></span><span style="font-family:Verdana;"><font size="2">The first step in copying a file is to set up an instance of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span>. Then you can execute its <span class="fixed1"><span style="font-family:Verdana;">CopyFile()</span></span> method as shown here.</font><font size="2"> </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">fsoObject.CopyFile("d:\ displayText.txt", "d:\myDocs\ displayText.txt")</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">In this example, a file named <span class="fixed1"><span style="font-family:Verdana;">myFile.txt</span></span> is copied from the root folder on the <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> drive to a folder named <span class="fixed1"><span style="font-family:Verdana;">myDocs</span></span> located on the computer’s <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drive. You can modify this example to copy more than one file using wildcard characters as shown in the next example. Here all files in the root directly with a filename of <span class="fixed1"><span style="font-family:Verdana;">myFile</span></span> are copied to the destination folder regardless of their file extension. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">fsoObject.CopyFile("d:\ displayText.*", "d:\Docs")</font></span></b></pre>
<h4><span style="font-size:10pt;font-family:Verdana;">Moving Files</span></h4>
<p><span style="font-family:Verdana;"><font size="2">Moving files is similar to copying them except that instead of leaving the original file in place and placing a duplicate copy in the destination location, the original file is moved leaving only one copy of the file. You can move one or more files using the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">MoveFile()</span></span> method.</font></span><span style="font-family:Verdana;"><font size="2">For example, you can move all files with a <span class="fixed1"><span style="font-family:Verdana;">.txt </span></span>file extension found in the root of the <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> drive to a <span class="fixed1"><span style="font-family:Verdana;">myDocs</span></span> folder on the <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drive using the following VBScript statements. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">fsoObject.MoveFile("c:\*.txt", "c:\Docs")</font></span></b></pre>
<p><strong><span style="font-size:10pt;font-family:Verdana;">Deleting Files</span></strong><br />
<span style="font-family:Verdana;"><font size="2">You can use the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">DeleteFile()</span></span> method to delete one or more files. For example, you might want to write a script that cleans out a folder at the end of each day or that deletes files after reading and processing them. You can delete one or more files as demonstrated here. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">fsoObject.DeleteFile("d:\*.txt")</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">Here all files that have a <span class="fixed1"><span style="font-family:Verdana;">.txt</span></span> file extension located in the root of the <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> drive will be deleted.</font></span><br />
<strong><span style="font-size:10pt;font-family:Verdana;">Creating a Folder</span></strong><br />
<span style="font-family:Verdana;"><font size="2">Working with folders is similar to working with files. You can use the <span class="fixed1"><span style="font-family:Verdana;">FolderExists(</span></span>) method of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> to determine if a folder exists. If the folder does not exist, you can create it using the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">CreateFolder()</span></span> method as demonstrated here. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">If (fsoObject.FolderExists("d:\Docs") = false) Then</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">Set myFolder = fsoObject.CreateFolder("d:\Docs")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">End If</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">The first thing that this example does is check to see if a folder named <span class="fixed1"><span style="font-family:Verdana;">myDocs</span></span> already exists on the computer’s <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drive. If it does not exist, then the folder is created. Otherwise nothing happens.</font></span><br />
<strong><span style="font-size:10pt;font-family:Verdana;">Copying Folders</span></strong><br />
<span style="font-family:Verdana;"><font size="2">Copying a folder is pretty much the same as copying a file. The folder and all its contents are copied to a new location leaving the original copy still in place. You can copy folders using the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">CopyFolder()</span></span> method.</font></span><span style="font-family:Verdana;"><font size="2">Take a look at the following example. It copies a folder named <span class="fixed1"><span style="font-family:Verdana;">myDocs</span></span> located on the computer’s <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drive to its <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> drive. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">fsoObject.CopyFolder("c:\Docs", "d:\Docs")</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">As you can see the <span class="fixed1"><span style="font-family:Verdana;">CopyFolder()</span></span> methods requires two arguments, the source and destination folder names, including their complete paths. By changing the name assigned to the destination folder, you can rename the folder as part of the copy operation as demonstrated here. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">fsoObject.CopyFolder("c:\Docs", "d:\NewDocs")</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">If the destination folder already exists, then the contents of the source folder are copied into it alongside its current contents. The <span class="fixed1"><span style="font-family:Verdana;">CopyFolder()</span></span> method supports an additional third parameter that allows you to tell it what to do if the destination folder contains files with duplicate filenames of those found in the source folder. This parameter is set to either a value of <span class="fixed1"><span style="font-family:Verdana;">true</span></span> or <span class="fixed1"><span style="font-family:Verdana;">false</span></span>. Setting it to <span class="fixed1"><span style="font-family:Verdana;">true</span></span> causes any matching files to be overridden. Setting it to <span class="fixed1"><span style="font-family:Verdana;">false</span></span> prevents this from happening. Let’s look at a couple examples.</font><font size="2"> </font></span><span style="font-family:Verdana;"><font size="2">The first example prevents files with duplicate filenames from being overridden.</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">fsoObject.CopyFolder("c:\Docs", "d:\Docs", "False")</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">The second example allows files with duplicate names to be overridden in the destination folder.</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">fsoObject.CopyFolder("c:\Docs", "d:\Docs", "True")</font></span></b></pre>
<p><strong><span style="font-size:10pt;font-family:Verdana;">Moving Folders</span></strong><br />
<span style="font-family:Verdana;"><font size="2">Moving a folder works pretty much the same as copying one except that moving the folder leaves you with only the one copy. You can move folders using the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">MoveFolder()</span></span> method. This method moves a folder and all its contents, including subfolders, to a new destination.</font></span><span style="font-family:Verdana;"><font size="2">For example, the following VBScript statements move a folder called <span class="fixed1"><span style="font-family:Verdana;">myDocs</span></span> from the computer’s <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drive to its <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> drive. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">fsoObject.MoveFolder("c:\Docs", "d:\Docs")</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">If a folder with the same name already exists at the root of the computer’s <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drive, then the contents of the source folder will be copied into the existing destination along side its current contents.</font></span></p>
<h4><span style="font-size:10pt;font-family:Verdana;">Deleting Folders</span></h4>
<p><span style="font-family:Verdana;"><font size="2">You can delete one or more folders using the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">DeleteFolder()</span></span> method. This method deletes a folder and all its contents, including subfolders. For example, the following VBScript statements can be used to delete a folder named <span class="fixed1"><span style="font-family:Verdana;">myDocs</span></span> located on a computer’s <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drive. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">fsoObject.DeleteFolder("d:\Docs")</font></span></b></pre>
<p><strong><span style="font-size:10pt;font-family:Verdana;">Managing Files with the File Object</span></strong></p>
<p><span style="font-family:Verdana;"><font size="2">The <span class="fixed1"><span style="font-family:Verdana;">File</span></span> Object allows you to work with one file at a time as opposed to the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span>, which lets you manage multiple files. Using the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object instead of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> requires a little more work. You still have to create an instance of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> to interact with the file system. You also need to use the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">GetFile()</span></span> method to retrieve a <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object that represents the file that your script will be managing. Once these two things are set up you can execute any of the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object’s methods.</font></span></p>
<h4><span style="font-size:10pt;font-family:Verdana;">Copying a File</span></h4>
<p><span style="font-family:Verdana;"><font size="2">Using the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">Copy()</span></span> method you can copy a file from one location to another. This method does not support the use of wildcard characters and cannot therefore be used to copy multiple files.</font></span><span style="font-family:Verdana;"><font size="2">The following example demonstrates how to use the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">Copy()</span></span> method to copy a file named <span class="fixed1"><span style="font-family:Verdana;">myFile.txt</span></span> from the <span class="fixed1"><span style="font-family:Verdana;">myDocs</span></span> folder on the computer’s <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drive to the root of the <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> drive.</font><font size="2"> </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">Set source_file = fsoObject.GetFile("c:\Docs\ displayText.txt")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">source_file.Copy("d:\")</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">In this example, the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">GetFile()</span></span> method is used to establish a reference to the file that is to be copied. Then the <span class="fixed1"><span style="font-family:Verdana;">Copy()</span></span> method is used to set the destination where the file is to be copied.</font></span></p>
<p><strong><span style="font-size:10pt;font-family:Verdana;">Moving a File</span></strong></p>
<p><span style="font-family:Verdana;"><font size="2">As you probably expect by now, moving a file using the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">Move()</span></span> method works almost exactly like copying it using the <span class="fixed1"><span style="font-family:Verdana;">Copy()</span></span> method. For example, the following VBScript statements demonstrate how to move a file from one location to another. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">Set source_file = fsoObject.GetFile("c:\Docs\ displayText.txt")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">source_file.Move("d:\")</font></span></b></pre>
<h4><span style="font-size:10pt;font-family:Verdana;">Deleting a File</span></h4>
<p><span style="font-family:Verdana;"><font size="2">You can delete an individual file using the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> Object’s <span class="fixed1"><span style="font-family:Verdana;">Delete()</span></span> method. Like the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object’s other methods, the <span class="fixed1"><span style="font-family:Verdana;">Delete()</span></span> method does not support wildcard characters limiting it to being able to delete just one file at a time.</font></span><span style="font-family:Verdana;"><font size="2">Take a look at the following example. Here a file named <span class="fixed1"><span style="font-family:Verdana;">myFile.txt</span></span> is deleted from a folder named <span class="fixed1"><span style="font-family:Verdana;">myDocs</span></span> located on the computer’s <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drive. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">Set source_file = fsoObject.GetFile("c:\Docs\ displayText.txt ")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">source_file.Delete()</font></span></b></pre>
<p><strong><span style="font-size:10pt;font-family:Verdana;">Managing Folders with the Folder Object</span></strong><br />
<span style="font-family:Verdana;"><font size="2">The <span class="fixed1"><span style="font-family:Verdana;">Folder</span></span> object is similar to the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object only it works with one folder at a time instead of one file at a time. Like the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object, it requires a little more work to set up than does simply using the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span>. First, you’ll need to instantiate the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span>. Then you must use the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">GetFolder()</span></span> method to retrieve a <span class="fixed1"><span style="font-family:Verdana;">Folder</span></span> object that represents the folder that your script will be working with. Once these two things are set up you can execute any of the <span class="fixed1"><span style="font-family:Verdana;">Folder</span></span> object’s methods.</font><font size="2"> </font></span></p>
<h4><span style="font-size:10pt;font-family:Verdana;">Copying a Folder</span></h4>
<p><span style="font-family:Verdana;"><font size="2">Like the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object, the <span class="fixed1"><span style="font-family:Verdana;">Folder</span></span> object supports the <span class="fixed1"><span style="font-family:Verdana;">Copy()</span></span> method. Because it doesn’t support wildcard characters it is useful only when you want to work with a single folder at a time. The <span class="fixed1"><span style="font-family:Verdana;">Copy()</span></span> method copies the folder and all its contents, including any subfolders, to a new location.</font></span><span style="font-family:Verdana;"><font size="2">For example, the following VBScript statements demonstrate how to use the <span class="fixed1"><span style="font-family:Verdana;">Copy()</span></span> method. In this case a folder named <span class="fixed1"><span style="font-family:Verdana;">myDocs</span></span> is copied from the root of the computer’s <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drive to the root of the computer’s <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> drive. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">Set source_folder = fsoObject.GetFolder("d:\Docs")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">source_folder.Copy("c:\")</font></span></b></pre>
<p><strong><span style="font-size:10pt;font-family:Verdana;">Moving a Folder</span></strong><br />
<span style="font-family:Verdana;"><font size="2">The <span class="fixed1"><span style="font-family:Verdana;">Folder</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">Move()</span></span> method lets you move a folder from one location to another. This method recursively copies a folder and all its contents. Because it does not support wildcard characters, this method can only move one folder at a time, as opposed to the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">MoveFolder()</span></span> method, which can move any number of folders in a single operation.</font></span><span style="font-family:Verdana;"><font size="2">The following example demonstrates how to use this method to move a folder. In this case the folder is named <span class="fixed1"><span style="font-family:Verdana;">myDocs</span></span> and it is moved from the computer’s <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drive to its <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> drive.</font><font size="2"> </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">Set source_folder = fsoObject.GetFolder("d:\Docs")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">source_folder.Move("c:\")</font></span></b></pre>
<h4><span style="font-size:10pt;font-family:Verdana;">Deleting a Folder</span></h4>
<p><span style="font-family:Verdana;"><font size="2">You can delete a folder using the <span class="fixed1"><span style="font-family:Verdana;">Folder</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">Delete()</span></span> method. Wildcard character matching is not supported so it only works with one folder at a time. If you need to delete more than one folder you can use the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">DeleteFolder()</span></span> method, discussed earlier in this chapter.</font></span><span style="font-family:Verdana;"><font size="2">This method deletes the specified folder and all its contents, including subfolders. Its use is demonstrated here.</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">Set source_folder = fsoObject.GetFolder("d:\Docs")</font></span></b>
<b><span style="font-family:Verdana;"><font size="2">source_folder.Delete()</font></span></b></pre>
<p align="right"><a href="http://kuldeepse.wordpress.com/2007/11/11/qtp-script-for-sending-a-mail-using-outlook/"><font color="#000044">Next Step &#8211; QTP Script Examples</font></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kuldeepse.wordpress.com/125/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kuldeepse.wordpress.com/125/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuldeepse.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuldeepse.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kuldeepse.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kuldeepse.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kuldeepse.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kuldeepse.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kuldeepse.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kuldeepse.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kuldeepse.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kuldeepse.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kuldeepse.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kuldeepse.wordpress.com/125/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kuldeepse.wordpress.com/125/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kuldeepse.wordpress.com/125/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=125&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuldeepse.wordpress.com/2008/02/05/10-filesystemobject/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b37d5959686c283f564079068ff8246f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kuldeep</media:title>
		</media:content>
	</item>
		<item>
		<title>9: Scripting related to File system</title>
		<link>http://kuldeepse.wordpress.com/2008/02/05/9-scripting-related-to-file-system/</link>
		<comments>http://kuldeepse.wordpress.com/2008/02/05/9-scripting-related-to-file-system/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 11:16:24 +0000</pubDate>
		<dc:creator>kuldeep kumar</dc:creator>
				<category><![CDATA[Learn VBScript for QTP (Descriptive Programming)]]></category>

		<guid isPermaLink="false">http://kuldeepse.wordpress.com/?p=124</guid>
		<description><![CDATA[Working with File System The main runtime object is the FileSystemObject from which all other runtime objects are derived (except for the dictionary object, which is independent of the FileSystemObject). lists of VBScript runtime objects. FileSystemObject Object Access Provided Drive Disk drive properties Drives Collection System drive information File File properties Files Collection All files [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=124&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-size:10pt;font-family:Verdana;"><em>Working with File System</em></span></strong><br />
<span style="font-family:Verdana;"><font size="2">The main runtime object is the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> from which all other runtime objects are derived (except for the <span class="fixed1"><span style="font-family:Verdana;">dictionary</span></span> object, which is independent of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span>). lists of VBScript runtime objects.</font></span></p>
<table border="1" width="373" cellPadding="0" style="width:373px;height:226px;" class="MsoNormalTable">
<thead>
<td colSpan="2" style="background:white;border:#ece9d8;padding:0.75pt;"><strong><span><span style="font-size:10pt;font-family:Verdana;">FileSystemObject</span> </span></strong></td>
<tr>
<td width="50%" vAlign="top" style="background:white;width:50%;border:#ece9d8;padding:0.75pt;"><b><span style="font-size:10pt;font-family:Verdana;">Object</span></b></td>
<td width="50%" vAlign="top" style="background:white;width:50%;border:#ece9d8;padding:0.75pt;"><b><span style="font-size:10pt;font-family:Verdana;">Access Provided</span></b></td>
</tr>
<tr>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">Drive</span></span><span style="font-size:10pt;font-family:Verdana;"> </span></td>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">Disk drive properties</span></td>
</tr>
<tr>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">Drives Collection</span></span><span style="font-size:10pt;font-family:Verdana;"> </span></td>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">System drive information</span></td>
</tr>
<tr>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">File</span></span><span style="font-size:10pt;font-family:Verdana;"> </span></td>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">File properties</span></td>
</tr>
<tr>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">Files Collection</span></span><span style="font-size:10pt;font-family:Verdana;"> </span></td>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">All files contained in the specified folder</span></td>
</tr>
<tr>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">Folder</span></span><span style="font-size:10pt;font-family:Verdana;"> </span></td>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">Folder properties</span></td>
</tr>
<tr>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">Folders Collection</span></span><span style="font-size:10pt;font-family:Verdana;"> </span></td>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">All folders contained in the specified folder</span></td>
</tr>
</thead>
</table>
<p><span style="font-family:Verdana;"><font size="2">To use the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> within your VBScripts you must first establish an instance of it. You can do this using the <span class="fixed1"><span style="font-family:Verdana;">WScript</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">CreateObject()</span></span> method and by referencing it as <span class="fixed1"><span style="font-family:Verdana;">Scripting. FileSystemObject</span></span>. This is demonstrated in the following example. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = WScript.CreateObject ("Scripting.FileSystemObject")</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">Here <span class="fixed1"><span style="font-family:Verdana;">fsoObject</span></span> is just the name that I assigned to a variable that can now be used by the rest of the script to reference the properties and methods of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span>. With this instance of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> now established the script is read to interact with the Windows file system.</font></span><span style="font-family:Verdana;"><font size="2">Let’s put this previous <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> example to work in a few quick examples to see how it really works.</font><font size="2"> </font></span><br />
<span style="font-size:10pt;font-family:Verdana;">Displaying Drive Free Space</span></p>
<h3></h3>
<p><span style="font-family:Verdana;"><font size="2">This first example demonstrates how to use a number of methods and properties of the VBScript runtime objects to access drive information. Specifically the example shown here displays the amount of free space on a computer’s <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> and <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drives. </font></span></p>
<pre>
<b><span style="font-family:Verdana;"><font size="2">' * Script Name: Script 5.vbs<span>       </span>*</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Option Explicit</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">On Error Resume Next</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">dim fsoObject, drive1, drive2</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">set fsoObject = WScript.CreateObject("Scripting.FileSystemObject")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">set drive1 = fsoObject.GetDrive(fsoObject.GetDriveName("c:"))</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">set drive2 = fsoObject.GetDrive(fsoObject.GetDriveName("d:"))</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' ********* Main processing section **********</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' Call a function that displays drive information</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Free_Space()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' *********** Procedures go here *************</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' This function displays the amount of free space on drive 1 and drive 2</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Function Free_Space()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo( "Free Space on drive 1 is: " _</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"><span>  </span>&amp; FormatNumber(drive1.FreeSpace / 1024 , 0) &amp; " KB")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo( "Free Space on drive 2 is: " _</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"><span>  </span>&amp; FormatNumber(drive2.FreeSpace / 1024 , 0) &amp; " KB")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">End Function</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">The script begins by defining three variables. The first variable is <span class="fixed1"><span style="font-family:Verdana;">fsoObject</span></span>. It will be used to create an instance of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject </span></span>as discussed earlier. The next two variables will be used to set up references to the computer’s <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> and <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drives.</font></span><span style="font-family:Verdana;"><font size="2">The two statements that set up the values of these two variables for the computer’s drives probably look a little complex to you at first. So let’s take a moment and break them down. First, the <span class="fixed1"><span style="font-family:Verdana;">GetDriveName()</span></span> method of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> is used by appending it to the variable <span class="fixed1"><span style="font-family:Verdana;">fsoObject</span></span> (for example, <span class="fixed1"><span style="font-family:Verdana;">fsoObject.GetDriveName()</span></span>). Remember that the <span class="fixed1"><span style="font-family:Verdana;">fsoObject</span></span> variable provides the script with a reference to the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> and its properties and methods. The <span class="fixed1"><span style="font-family:Verdana;">GetDriveName()</span></span> method returns the name of the drive associated with the specified driver letter (that is, <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> or <span class="fixed1"><span style="font-family:Verdana;">D:</span></span>). Next, the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">GetDrive()</span></span> method is used to retrieve the <span class="fixed1"><span style="font-family:Verdana;">Drive</span></span> object associated with the specified drive name. The reason that we need to establish a reference to the <span class="fixed1"><span style="font-family:Verdana;">Drive</span></span> object is because we are going to want to use its <span class="fixed1"><span style="font-family:Verdana;">Freespace</span></span> property a little later in the script.</font><font size="2"> </font></span><span style="font-family:Verdana;"><font size="2">After executing the statements in the script’s initialization section, the VBScript statement in the main processing section executes. There is only one VBScript statement in this section and it calls a function named <span class="fixed1"><span style="font-family:Verdana;">Display_Msg()</span></span>. The function then executes. Its job is to display the amount of free space on each drive. This is accomplished by taking the amount of free space left on a given drive as contained by the <span class="fixed1"><span style="font-family:Verdana;">Drive</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">FreeSpace</span></span> property and dividing it by 1024 (1 kilobyte or 1 KB). The results are then formatted using the <span class="fixed1"><span style="font-family:Verdana;">Drive</span></span> object’s<span class="fixed1"><span style="font-family:Verdana;"> FormatNumber()</span></span> method, which in this case formats the number with zero trailing decimal spaces (that is, as whole number).</font></span><span style="font-family:Verdana;"><font size="2">When I ran this script on my computer, I got the following results.</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">C:\&gt;CScript "Script 5.vbs"</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Microsoft (R) Windows Script Host Version 5.6</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Free Space on drive 1 is: 11,116 KB</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Free Space on drive 2 is: 15,784 KB</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">C:\&gt;</font></span></b></pre>
<p><span style="font-size:10pt;font-family:Verdana;">Examining File System Types</span><br />
<span style="font-family:Verdana;"><font size="2">Let’s look at another example of how to work with the methods and properties of the VBScript runtime objects. This time we’ll write a VBScript example that displays the type of file system that the computer’s <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> and <span class="fixed1"><span style="font-family:Verdana;">D:</span></span> drives have been formatted with. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">' * Script Name: Script 6.vbs<span></span>*</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Option Explicit</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">On Error Resume Next</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">dim fsoObject, drive1, drive2</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">set fsoObject = WScript.CreateObject("Scripting.FileSystemObject")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">set drive1 = fsoObject.GetDrive("C:")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">set drive2 = fsoObject.GetDrive("D:")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' ********* Main processing section **********</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' Call a function that displays drive information</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Used_Disk()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' *********** Procedures go here *************</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' This function displays the file system used to format drive 1 and drive 2</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Function Used_Disk()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo("The file system used on drive 1 is: " &amp; drive1.FileSystem)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo("The file system used on drive 2 is: " &amp; drive2.FileSystem)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">End Function</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">As you can see this VBScript is similar to the previous example. The same variables are defined in the initialization section. In addition, the same instance of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> is set up and once again its <span class="fixed1"><span style="font-family:Verdana;">GetDrive()</span></span> method is used to retrieve <span class="fixed1"><span style="font-family:Verdana;">Drive</span></span> object references to each drive on the computer.</font></span><span style="font-family:Verdana;"><font size="2">Next, a single VBScript statement in the main processing section calls a function that displays a file system type for each drive. This is accomplished by using <span class="fixed1"><span style="font-family:Verdana;">Drive</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">FileSystem</span></span> property.</font></span><span style="font-family:Verdana;"><font size="2">When I ran this script on my computer I received the following results.</font><font size="2"> </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">C:\&gt;CScript "Script 6.vbs"</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Microsoft (R) Windows Script Host Version 5.6</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">The file system used on drive 1 is: NTFS</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">The file system used on drive 2 is: NTFS</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">C:\&gt;</font></span></b></pre>
<p><span style="font-size:10pt;font-family:Verdana;">Examining File Properties</span><br />
<span style="font-family:Verdana;"><font size="2">Let’s look at one final example before we rush off and begin to master the art of reading from and writing to text files. This example starts off like the previous two examples by defining its variables and instantiating an instance of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span>. This time the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">GetFile()</span></span> method is used. This method is used to retrieve the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object associated with the specified file, which in this example is <span class="fixed1"><span style="font-family:Verdana;">c:\winzip.log</span></span>.</font></span><span style="font-family:Verdana;"><font size="2">Again, a VBScript statement in the main processing section calls on a function named <span class="fixed1"><span style="font-family:Verdana;">Display_Msg()</span></span>. The function contains a number of <span class="fixed1"><span style="font-family:Verdana;">WScript.Echo</span></span> statements each of which displays a different property associated with the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">' ********************************************</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' * Script Name: Script 7.vbs<span>       </span>*</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' * Author: Kuldeep<span>            </span>*</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' * Created: 03/02/08<span>            </span>*</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' ********************************************</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' **** Perform script initialization here ****</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Option Explicit</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">On Error Resume Next</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">dim fsoObject, targetFile</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">set fsoObject = WScript.CreateObject("Scripting.FileSystemObject")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">set targetFile = fsoObject.GetFile("d:\Test.vbs")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' ********* Main processing section **********</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' Call a function that displays drive information</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Details()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' *********** Procedures go here *************</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' This function displays file properties</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Function Details()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo("File properties of d:\Test.vbs")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo("-----------------------------------")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo("Created on:<span>  </span>" &amp; targetFile.DateCreated)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo("Last Modified: " &amp; targetFile.DateLastModified)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo("Last Accessed: " &amp; targetFile.DateLastAccessed)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo("File Name:<span>   </span>" &amp; targetFile.Name)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo("File Path:<span>   </span>" &amp; targetFile.Path)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo("File Type:<span>   </span>" &amp; targetFile.Type)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo("File Size:<span>   </span>" &amp; targetFile.Size)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">End Function</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">The following output was displayed when I ran this script.</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">C:\&gt;CScript "Script 7.vbs"</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Microsoft (R) Windows Script Host Version 5.6</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">File properties of d:\Test.vbs</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">-----------------------------------</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Created on:<span>  </span>2/4/2008 11:23:36 PM</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Last Modified: 2/4/2008 10:38:52 AM</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Last Accessed: 2/4/2008</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">File Name:<span>   </span>Test.vbs</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">File Path:<span>   </span>D:\Test.vbs</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">File Type:<span>   </span>VBScript Script File </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">File Size:<span>   </span>1081</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">C:\&gt;</font></span></b> <b><span style="font-family:Verdana;"><font size="2"> </font></span></b></pre>
<p><span style="font-size:10pt;font-family:Verdana;"><em>Creating Documents, Reports, and Logs</em></span><span style="font-family:Verdana;"><font size="2">By this point you should have a fairly good understanding of what the VBScript runtime objects are and what they can do. Now let’s look at how you can use them to generate reports, logs, and other types of text documents.</font></span><span style="font-family:Verdana;"><font size="2">To work with files and their contents you must first establish an instance of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> within your VBScript as shown here. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">set fsoObject = WScript.CreateObject("Scripting.FileSystemObject")</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">Next, you should always check to see if the file that you want to work with already exists. If it does, you can open it. If it does not already exist, you can create it and then open it. You can check to see if a file exists using the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">FileExists</span></span> property as shown here. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">If (fsoObject.FileExists("C:\displayText.txt" ) ) Then</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">You must open a file before you can work with it. You can use the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">OpenTextFile()</span></span> method to open files. To use this method you need to supply a few pieces of information including the following.</font></span><span style="font-family:Verdana;"><font size="2"> </font></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-family:Verdana;"><font size="2">The name and path of the file to be opened</font></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-family:Verdana;"><font size="2">Whether you want the file to be opened for reading, writing, or appending</font></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-family:Verdana;"><font size="2">Whether to create the file if it does not exist</font></span><span style="font-family:Verdana;"><span style="color:windowtext;"><font size="2">Table </font></span><font size="2">defines constants that are used to tell the <span class="fixed1"><b><span style="font-family:Verdana;">OpenTextFile()</span></b></span> method what you want to do once the file is opened.</font></span><span style="font-family:Verdana;"><font size="2"> </font></span></p>
<table border="1" width="501" cellPadding="0" style="width:501px;height:122px;" class="MsoNormalTable">
<thead>
<td colSpan="3" style="background:white;border:#ece9d8;padding:0.75pt;"><strong><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">OpenTextFile()</span></span><span><span style="font-size:10pt;font-family:Verdana;"><font color="#800000"> Constants</font></span> </span></strong></td>
<tr>
<td width="36%" vAlign="top" style="background:white;width:36%;border:#ece9d8;padding:0.75pt;"><b><span style="font-size:10pt;font-family:Verdana;">Constant</span></b></td>
<td width="32%" vAlign="top" style="background:white;width:32%;border:#ece9d8;padding:0.75pt;"><b><span style="font-size:10pt;font-family:Verdana;">Description</span></b></td>
<td width="32%" vAlign="top" style="background:white;width:32%;border:#ece9d8;padding:0.75pt;"><b><span style="font-size:10pt;font-family:Verdana;">Value</span></b></td>
</tr>
<tr>
<td width="36%" vAlign="top" style="width:36%;background-color:transparent;border:#ece9d8;padding:0;"><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">ForReading</span></span><span style="font-size:10pt;font-family:Verdana;"> </span></td>
<td width="32%" vAlign="top" style="width:32%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">Opens a file for reading</span></td>
<td width="32%" vAlign="top" style="width:32%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">1</span></td>
</tr>
<tr>
<td width="36%" vAlign="top" style="width:36%;background-color:transparent;border:#ece9d8;padding:0;"><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">ForWriting</span></span><span style="font-size:10pt;font-family:Verdana;"> </span></td>
<td width="32%" vAlign="top" style="width:32%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">Opens a file for writing</span></td>
<td width="32%" vAlign="top" style="width:32%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">2</span></td>
</tr>
<tr>
<td width="36%" vAlign="top" style="width:36%;background-color:transparent;border:#ece9d8;padding:0;"><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">ForAppending</span></span><span style="font-size:10pt;font-family:Verdana;"> </span></td>
<td width="32%" vAlign="top" style="width:32%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">Opens a file for appending</span></td>
<td width="32%" vAlign="top" style="width:32%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">8</span></td>
</tr>
</thead>
</table>
<p><span style="font-family:Verdana;"><span style="color:windowtext;"><font size="2">Table </font></span><font size="2">defines two options that govern what the <span class="fixed1"><b><span style="font-family:Verdana;">OpenTextFile()</span></b></span> method should do when the file to be opened does and does not exist.</font></span><span style="font-family:Verdana;"><font size="2"> </font></span></p>
<table border="1" width="419" cellPadding="0" style="width:419px;height:130px;" class="MsoNormalTable">
<thead>
<td colSpan="2" style="background:white;border:#ece9d8;padding:0.75pt;"><strong><span class="table-titlelabel"><span style="font-size:10pt;font-family:Verdana;">Table : </span></span><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">OpenTextFile()</span></span><span><span style="font-size:10pt;font-family:Verdana;"><font color="#800000"> File Creation Options</font></span> </span></strong></td>
<tr>
<td width="50%" vAlign="top" style="background:white;width:50%;border:#ece9d8;padding:0.75pt;"><b><span style="font-size:10pt;font-family:Verdana;">Value</span></b></td>
<td width="50%" vAlign="top" style="background:white;width:50%;border:#ece9d8;padding:0.75pt;"><b><span style="font-size:10pt;font-family:Verdana;">Description</span></b></td>
</tr>
<tr>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">True</span></span><span style="font-size:10pt;font-family:Verdana;"> </span></td>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">Open the file if it exists, otherwise create and open it</span></td>
</tr>
<tr>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span class="fixed1"><span style="font-size:10pt;font-family:Verdana;">False</span></span><span style="font-size:10pt;font-family:Verdana;"> </span></td>
<td width="50%" vAlign="top" style="width:50%;background-color:transparent;border:#ece9d8;padding:0;"><span style="font-size:10pt;font-family:Verdana;">Open the file if it exists, otherwise do not create it</span></td>
</tr>
</thead>
</table>
<p><span style="font-size:10pt;font-family:Verdana;">Opening and Closing Files</span></p>
<h3></h3>
<p><span style="font-family:Verdana;"><font size="2">It is very important that you correctly specify the type of operation that you are opening a file for (reading, writing, or appending). If you open a file to write to it and the file exists, then the file will be reinitialized. In other words, any data that is already in the file is lost and the file pointer is placed at the beginning of the new file (in the first row and column of the file).</font></span><span style="font-family:Verdana;"><font size="2">By appending to a file, you are able to preserve its contents and add to it. In other words, the file is opened and the file pointer is placed at the end of the file in the last row and column position.</font></span><span style="font-family:Verdana;"><font size="2">The file pointer is used to identify where the next character of data will be placed with a file. In a newly initialized file, the pointer would automatically be positioned in the upper-left corner (row 0, column 0). If one new character of information were added, the pointer would be moved over one position to column 1 in row 0. If a carriage return were added (indicating an end-of-line marker), then the file pointer would move to column 0 row 1. Knowing the location of the file pointer and how it is moved around is important, especially if you will be writing to or reading from files that have fixed record formats with data fields starting and ending in specified column positions.</font><font size="2"> </font></span><span style="font-family:Verdana;"><font size="2">Okay, enough about the file pointer. Let’s look at an example that ties together everything that we have talked about. In this example, I’ve written a VBScript that opens a file named <span class="fixed1"><span style="font-family:Verdana;">myFile.txt</span></span>, which resides in the root directory of my <span class="fixed1"><span style="font-family:Verdana;">C:</span></span> drive. If the file already exists, then the script opens it but if it does not already exist it will be created and opened. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">' * Script Name: Script 8.vbs<span>       </span>*</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Option Explicit</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">On Error Resume Next</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Dim fsoObject, open_File, target_File</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Set fsoObject = WScript.CreateObject("Scripting.FileSystemObject")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">target_File = "D:\ displayText.txt"</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' ********* Main processing section **********</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' Call a function that displays drive information</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Open_File()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_File.WriteLine "This line of data should be written to the text file."</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Close_File()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' *********** Procedures go here *************</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' This function opens a file</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Function Open_File()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> If (fsoObject.FileExists(target_File ) ) Then</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"><span>  </span>Set open_File = fsoObject.OpenTextFile(target_File, 8 )</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> Else</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"><span>  </span>Set open_File = fsoObject.OpenTextFile(target_File, 2, "True" )</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> End If</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">End Function</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">' This function closes a file</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Function Close_File()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> open_File.Close()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">End Function</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">The file is opened using the <span class="fixed1"><span style="font-family:Verdana;">forWriting</span></span> constant ( with a value of 2 ) if it already exists. If the file does not exist, then the <span class="fixed1"><span style="font-family:Verdana;">forAppending</span></span> constant (with a value of 8 ) is specified to open the file and place the file pointer at the end of the file.</font></span><span style="font-family:Verdana;"><font size="2">If you take at look at the script’s main processing section you will see the following statement between a pair of function calls, which open and close the file.</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">open_File.WriteLine "This line of data should be written to the text file."</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">This statement writes one line of data to the file and executes a carriage return placing the file pointer in the first column of the following line. I’ll talk more about the use of this and other methods that are used to write data to files in just a bit.</font><font size="2"> </font></span><span style="font-family:Verdana;"><font size="2">The last statement in the main processing section calls a function that executes the following statement.</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">open_File.Close()</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">This statement executed the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">close()</span></span> method i to close the opened file. You must remember to close any file that you open before allowing your script to end. Failing to do so may cause an error the next time that you open the file because the end-of-file marker will not have been created.</font></span><span style="font-family:Verdana;"><font size="2">Run this script and open the <span class="fixed1"><span style="font-family:Verdana;">myFile.txt</span></span> file and you’ll see the following line of data. </font></span><br />
<span style="font-family:Verdana;"><font size="2">This line of data should be written to the text file.</font></span></p>
<p><span style="font-size:10pt;font-family:Verdana;"><strong>Writing to Files</strong><br />
</span><br />
<span style="font-family:Verdana;"><font size="2">As you just learned, you should always check for the existence of a file before creating it. Once opened, you have several different ways in which you can write text data to your files.One option is to write a specific number of characters at a time. This technique is best used when you need to write carefully formatted data to your files such as when you write reports with data that appears in columns. Another option for writing to a file is to write an entire line of data at a time. This technique is best used when your documents are more free-formed and is probably the option that you’ll use most often, especially if you plan to create log files in which you record error messages and other types of event information as your scripts execute.Finally, you might want to add blank lines to your files. Blank lines are especially useful for formatting your documents to improve their presentation and make them easier to read.</font></span><span style="font-size:10pt;font-family:Verdana;"><br />
<strong>Adding Characters to a File</strong></span><br />
<span style="font-family:Verdana;"><font size="2">You can write a specific number of characters to a file at a time using the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">Write()</span></span> method. This method does not automatically append a carriage return at the end of each write operation. Therefore, the next time a write operation occurs additional text is inserted immediately following the text written by the previous write operation.</font></span><span style="font-family:Verdana;"><font size="2">The following example demonstrates how you can use the <span class="fixed1"><span style="font-family:Verdana;">Write()</span></span> method to append text to an existing file. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = WScript.CreateObject("Scripting.FileSystemObject")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Set open_file = fsoObject.OpenTextFile("d:\ displayText.txt", 8 )</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.Write("Welcome to ")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.Write("KR Testing Solutions!")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.Close()</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">As you can see even though two separate write operations occurred, the text for both write operations was placed on the same line.</font></span><br />
<span style="font-size:10pt;font-family:Verdana;">Adding a Line to a File</span></p>
<h3></h3>
<p><span style="font-family:Verdana;"><font size="2">By replacing the <span class="fixed1"><span style="font-family:Verdana;">Write()</span></span> method with the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">WriteLine()</span></span> method in the previous example, you can change the previous script to write data to the file a line at a time. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = WScript.CreateObject("Scripting.FileSystemObject")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Set open_file = fsoObject.OpenTextFile("d:\ displayText.txt", 8 )</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.WriteLine("Welcome to KR Testing Solutions!")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.Close()</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">The <span class="fixed1"><span style="font-family:Verdana;">WriteLine()</span></span> method automatically adds a carriage return to the end of each line returning the file pointer to the first column of the next line.</font></span><br />
<span style="font-size:10pt;font-family:Verdana;">Adding Blank Lines to a File</span></p>
<h3></h3>
<p><span style="font-family:Verdana;"><font size="2">If you want to format your text files with blank lines to create better looking reports or make them easier to read you can use the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">WriteBlankLines()</span></span> method. When executed, this method writes a blank line to the file and executes a carriage return.</font></span><span style="font-family:Verdana;"><font size="2">The following example demonstrates how to use the <span class="fixed1"><span style="font-family:Verdana;">WriteBlankLines()</span></span> method to format the data in a small report. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = WScript.CreateObject("Scripting.FileSystemObject")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Set myCDrive = fsoObject.GetDrive("d:")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Set open_file = fsoObject.OpenTextFile("d:\ displayText.txt", 8 )</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.WriteLine("------------------------------")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.WriteBlankLines(1)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.WriteLine("<span>   </span>My d: Drive Report<span>   </span>")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.WriteBlankLines(1)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.WriteLine("------------------------------")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.WriteBlankLines(2)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.WriteLine("File System - " &amp; myCDrive.FileSystem)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.WriteLine("Total Size - " &amp; myCDrive.TotalSize)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.WriteLine("Free Space - " &amp; myCDrive.AvailableSpace)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.Close()</font></span></b><strong><span style="font-size:10pt;font-family:Verdana;">Reading from Files</span></strong></pre>
<p><span style="font-family:Verdana;"><font size="2">Reading the contents of a file is handled in much the same way as writing to it. First, be sure that the file exists. If it does, then your script may open it. The next thing your script should do is use the <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">AtEndOfStream</span></span> property to find out if the file has any data in it. After all, there is no point to trying to read an empty file. In fact, you should check the value of the <span class="fixed1"><span style="font-family:Verdana;">AtEndOfStream</span></span> property just before each read operation to be sure that your script has not reached the end of file marker (e.g., the end of the file).</font><font size="2"> </font></span><span style="font-family:Verdana;"><font size="2">The first thing that you need to do to begin reading a text file is create an instance of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> and then use the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">OpenTextFile()</span></span> method as shown here. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Set open_file = fsoObject.OpenTextFile("d:\ displayText.txt", 1 )</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">As you can see the <span class="fixed1"><span style="font-family:Verdana;">forReading</span></span> constant has been specified. Next you could set up a loop that runs until the <span class="fixed1"><span style="font-family:Verdana;">AtEndOfStream</span></span> property has a value of <span class="fixed1"><span style="font-family:Verdana;">true</span></span> (the end of the file is reached). During each iteration of the loop your script should read a line of text using the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">ReadLine()</span></span> method as shown here. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Do while False = open_file.AtEndOfStream</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> WScript.Echo(open_file.ReadLine())</font></span></b> <font size="2">  </font><font size="2">  

<b><span style="font-family:Verdana;">Loop</span></b></font> <font size="2">  

<b><span style="font-family:Verdana;"></span></b><b><span style="font-family:Verdana;"></span></b></font> </pre>
<p><span style="font-family:Verdana;"><font size="2">The preceding VBScript statements will process every line in the file, </font></span><span style="font-family:Verdana;"><font size="2">terminating when the end of file marker is reached. After your script </font></span><span style="font-family:Verdana;"><font size="2">is done reading the file, it can close it as shown here.</font></span><span style="font-family:Verdana;"><font size="2"></font></span><span style="font-family:Verdana;"><font size="2"><br />
<b><span style="font-family:Verdana;"><font size="2">open_file.Close</font></span></b><br />
<span style="font-family:Verdana;"><font size="2">If you put these lines of code together and ran them as a script using the CScript execution host you’d see output similar to the following.</font></span></font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">C:\&gt;CScript test.vbs</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Microsoft (R) Windows Script Host Version 5.6</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">------------------------------</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"><span>   </span>My d: Drive Report</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">------------------------------</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">File System - NTFS</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Total Size - 2146631554</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Free Space - 234554452</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">C:\&gt;</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">In this example we read an entire file by reading it one line at a time. There are a number of other techniques for reading files. These include</font></span><span style="font-family:Verdana;"><font size="2"> </font></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-family:Verdana;"><font size="2">Skipping lines when reading a file</font></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-family:Verdana;"><font size="2">Reading a specified number of characters from a file</font></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><span style="font-family:Verdana;"><font size="2">Reading an entire file in one operation</font></span><br />
<span style="font-size:10pt;font-family:Verdana;">Skipping Portions of a File</span></p>
<h3></h3>
<p><span style="font-family:Verdana;"><font size="2">If a file has headers or other information that you are not interested in reading you can always skip them and read only the portion of the file that interests you. For example, the file that we have been working with contains a five-line header followed by two blank lines after which the data in the report begins.</font></span><span style="font-family:Verdana;"><font size="2">You can use either of the following methods, both of which belong to the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span>, to skip text in a file.</font></span><span style="font-family:Verdana;"><font size="2"> </font></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Skip()</span></b></span><span style="font-family:Verdana;">. Skip a specific number of characters</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">SkipLine()</span></b></span><span style="font-family:Verdana;">. Skips a line</span></font><span style="font-family:Verdana;"><font size="2">The <span class="fixed1"><span style="font-family:Verdana;">Skip()</span></span> method lets you supply a number indicating how many characters should be skipped. For example, the following statement would skip 25 characters in a file referenced as <span class="fixed1"><span style="font-family:Verdana;">open_file</span></span>. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">open_file.Skip(25)</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">Unfortunately, the <span class="fixed1"><span style="font-family:Verdana;">SkipLine()</span></span> method does not allow you to pass it a number, indicating how many lines to skip. If you want to skip more than one line, you can wrap the method up inside a loop as demonstrated here. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">For i = 1 to 7</font></span></b><b><span style="font-family:Verdana;"><font size="2">open_file.SkipLine()</font></span></b><b><span style="font-family:Verdana;"><font size="2">Next</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">Here the first seven lines of the file referenced as <span class="fixed1"><span style="font-family:Verdana;">open_file</span></span> would be skipped.</font><font size="2"> </font></span><br />
<span style="font-size:10pt;font-family:Verdana;">Reading Formatted Data</span></p>
<h3></h3>
<p><span style="font-family:Verdana;"><font size="2">If your file has been formatted to contain fixed length data, then you have the option of reading it by character instead of by line. To do so you will use the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">Read()</span></span> method.</font></span><span style="font-family:Verdana;"><font size="2">The following example demonstrates how to use this method. Here a reference is set up for a file named <span class="fixed1"><span style="font-family:Verdana;">myfile.txt</span></span>. Then a <span class="fixed1"><span style="font-family:Verdana;">For</span></span> loop is set up to skip the first seven lines of the file using the <span class="fixed1"><span style="font-family:Verdana;">SkipLine()</span></span> method. Next the <span class="fixed1"><span style="font-family:Verdana;">Skip()</span></span> method is used to skip the first fourteen characters on the eighth line. Finally the next four characters, beginning with the twenty-third character are read and then displayed. Then the file is closed. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Set open_file = fsoObject.OpenTextFile("d:\ displayText.txt", 1 )</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">For i = 1 to 7</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> open_file.SkipLine()</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Next</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2"> </font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">open_file.Skip(14)</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">WScript.Echo("The file system in use on this drive is: "</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">&amp; open_file.Read(4))</font></span></b><b><span style="font-family:Verdana;"><font size="2">open_file.Close</font></span></b></pre>
<p><strong><span style="font-size:10pt;font-family:Verdana;">Reading Entire Files</span></strong></p>
<p><span style="font-family:Verdana;"><font size="2">Another way in which you can read files is to read the entire file all at once using the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> object’s <span class="fixed1"><span style="font-family:Verdana;">ReadAll()</span></span> method as demonstrated in the following example.</font><font size="2"> </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Set fsoObject = CreateObject("Scripting.FileSystemObject")</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">Set open_file = fsoObject.OpenTextFile("d:\ displayText.txt", 1 )</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">read_rpt = open_file.ReadAll()</font></span></b><b><span style="font-family:Verdana;"><font size="2">open_file.Close()</font></span></b><b><span style="font-family:Verdana;"><font size="2">MsgBox(read_rpt)</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">In this example, the entire file is read using a single statement, which assigns the data read by the <span class="fixed1"><span style="font-family:Verdana;">ReadAll()</span></span> method to a variable named <span class="fixed1"><span style="font-family:Verdana;">read_rpt</span></span>. The file is then closed and the value of <span class="fixed1"><span style="font-family:Verdana;">read_rpt</span></span> displayed using the VBScript <span class="fixed1"><span style="font-family:Verdana;">MsgBox()</span></span> function.</font></span></p>
<p><strong><span style="font-size:10pt;font-family:Verdana;">Performing File and Folder Administration</span></strong><br />
z<br />
<span style="font-family:Verdana;"><font size="2">Managing your files and folders can involve a lot of work. Using VBScript and the WSH you can automate much of this work. For example, typical file and folder tasks involve copying or moving files and folders from one location to another in order to create backups or better organize them. Administration may also include deleting files once they have been processed or after they have reached a certain age.</font></span><span style="font-family:Verdana;"><font size="2">You can use methods belonging to the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> to manage one or more files or folders at a time. <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> methods for handling files include</font></span><span style="font-family:Verdana;"><font size="2"> </font></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';"> </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">CopyFile()</span></b></span><b><span style="font-family:Verdana;">.</span></b><span style="font-family:Verdana;"> Copies one or more files.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">MoveFile()</span></b></span><b><span style="font-family:Verdana;">.</span></b><span style="font-family:Verdana;"> Moves one or more files to a different location.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">DeleteFile().</span></b></span><span style="font-family:Verdana;"> Delete one or more files.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">FileExists()</span></b></span><span style="font-family:Verdana;">. Provides verification of whether a file contains data.</span></font><span style="font-family:Verdana;"><font size="2">The <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span> also provides a number of methods that you can use to manage Windows folders, including</font></span><span style="font-family:Verdana;"><font size="2"> </font></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">CopyFolder()</span></b></span><span style="font-family:Verdana;">. Copies one or more folders.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">MoveFolder()</span></b></span><span style="font-family:Verdana;">. Moves one or more folders to a different location.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">DeleteFolder()</span></b></span><span style="font-family:Verdana;">. Deletes one or more folders.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">FolderExists()</span></b></span><span style="font-family:Verdana;">. Provides verification of whether a folder exists.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">CreateFolder()</span></b></span><span style="font-family:Verdana;">. Creates a new folder.</span></font><span style="font-family:Verdana;"><font size="2">Alternatively, you can also use the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> and <span class="fixed1"><span style="font-family:Verdana;">Folder</span></span> objects to manage your files and folders instead of the <span class="fixed1"><span style="font-family:Verdana;">FileSystemObject</span></span>. These two objects share many of the same methods, including</font></span><span class="fixed1"><span style="font-family:Verdana;"><font size="2"> </font></span></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Copy()</span></b></span><span style="font-family:Verdana;">. Copies a file or folder to the specified location.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Delete()</span></b></span><span style="font-family:Verdana;">. Removes the specified file or folder.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Move()</span></b></span><span style="font-family:Verdana;">. Moves a file or folder to the specified location. </span></font></p>
<p align="right"><a href="http://kuldeepse.wordpress.com/2008/02/05/10-filesystemobject/"><font color="#000044">Next Step &#8211; File System Object</font></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kuldeepse.wordpress.com/124/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kuldeepse.wordpress.com/124/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuldeepse.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuldeepse.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kuldeepse.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kuldeepse.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kuldeepse.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kuldeepse.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kuldeepse.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kuldeepse.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kuldeepse.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kuldeepse.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kuldeepse.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kuldeepse.wordpress.com/124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kuldeepse.wordpress.com/124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kuldeepse.wordpress.com/124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=124&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuldeepse.wordpress.com/2008/02/05/9-scripting-related-to-file-system/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b37d5959686c283f564079068ff8246f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kuldeep</media:title>
		</media:content>
	</item>
		<item>
		<title>8: Files and Folders related Functions</title>
		<link>http://kuldeepse.wordpress.com/2008/02/05/8-files-and-folders-related-functions/</link>
		<comments>http://kuldeepse.wordpress.com/2008/02/05/8-files-and-folders-related-functions/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 08:49:49 +0000</pubDate>
		<dc:creator>kuldeep kumar</dc:creator>
				<category><![CDATA[Learn VBScript for QTP (Descriptive Programming)]]></category>

		<guid isPermaLink="false">http://kuldeepse.wordpress.com/?p=123</guid>
		<description><![CDATA[Files and Folders related Functions VBScript Runtime Properties Like the objects in the WSH core object model, VBScript runtime objects provide an extensive supply of properties. You can use the properties to view or change numerous file system attributes. These properties are listed here.  ·         AtEndOfLine. Returns a value of either true or false depending [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=123&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-size:10pt;font-family:Verdana;">Files and Folders related Functions</span></strong></p>
<p><strong><span style="font-size:10pt;font-family:Verdana;">VBScript Runtime Properties</span></strong></p>
<p><span style="font-family:Verdana;"><font size="2">Like the objects in the WSH core object model, VBScript runtime objects provide an extensive supply of properties. You can use the properties to view or change numerous file system attributes. These properties are listed here.</font></span><span style="font-family:Verdana;"><font size="2"> </font></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">AtEndOfLine</span></b></span><span style="font-family:Verdana;">. Returns a value of either <span class="fixed1"><span style="font-family:Verdana;">true</span></span> or <span class="fixed1"><span style="font-family:Verdana;">false</span></span> depending on whether the file pointer precedes the <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file’s end-of-line marker.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">AtEndOfStream</span></b></span><span style="font-family:Verdana;">. Returns a value of either <span class="fixed1"><span style="font-family:Verdana;">true</span></span> or <span class="fixed1"><span style="font-family:Verdana;">false</span></span> depending on whether the end of a <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file has been reached.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Attributes</span></b></span><span style="font-family:Verdana;">. Retrieves or sets file and folder attributes.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">AvailableSpace</span></b></span><span style="font-family:Verdana;">. Retrieves the amount of free space available on a drive.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Column</span></b></span><span style="font-family:Verdana;">. Retrieves the current column position within a <span class="fixed1"><br />
<span style="font-family:Verdana;">TextStream</span></span> file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">CompareMode</span></b></span><span style="font-family:Verdana;">. Retrieves or sets the comparison mode used to compare a <span class="fixed1"><span style="font-family:Verdana;">Dictionary</span></span> object’s string keys.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Count</span></b></span><span style="font-family:Verdana;">. Returns a count of the items in a collection or Dictionary object.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">DateCreated</span></b></span><span style="font-family:Verdana;">. Returns a file or folder’s creation date and time.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">DateLastAccessed</span></b></span><span style="font-family:Verdana;">. Returns the date and time that a file or folder was last accessed.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">DateLastModified</span></b></span><span style="font-family:Verdana;">. Returns the date and time that a file or folder was last modified.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Drive</span></b></span><span style="font-family:Verdana;">. Returns the drive letter representing the drive where a file or folder is stored.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">DriveLetter</span></b></span><span style="font-family:Verdana;">. Returns a drive’s drive letter.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Drives</span></b></span><span style="font-family:Verdana;">. Creates a <span class="fixed1"><span style="font-family:Verdana;">Drives</span></span> collection representing the computer’s <span class="fixed1"><span style="font-family:Verdana;">Drive</span></span> objects.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">DriveType</span></b></span><span style="font-family:Verdana;">. Returns a value indicating a drive’s type.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Files</span></b></span><span style="font-family:Verdana;">. Creates a <span class="fixed1"><span style="font-family:Verdana;">Files</span></span> collection representing the <span class="fixed1"><span style="font-family:Verdana;">File</span></span> objects stored inside a folder.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">FileSystem</span></b></span><span style="font-family:Verdana;">. Returns the file system type implemented on a drive.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">FreeSpace</span></b></span><span style="font-family:Verdana;">. Returns the amount of free space available to the user on a drive. </span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">IsReady</span></b></span><span style="font-family:Verdana;">. Returns a value of either <span class="fixed1"><span style="font-family:Verdana;">true</span></span> or <span class="fixed1"><span style="font-family:Verdana;">false</span></span> depending on whether a drive is available.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">IsRootFolder</span></b></span><span style="font-family:Verdana;">. Returns a value of either <span class="fixed1"><span style="font-family:Verdana;">true</span></span> or <span class="fixed1"><span style="font-family:Verdana;">false</span></span> identifying whether a folder is the root folder.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Item</span></b></span><span style="font-family:Verdana;">. Retrieves or sets an item based on the specified <span class="fixed1"><span style="font-family:Verdana;">Dictionary</span></span> object key.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Key</span></b></span><span style="font-family:Verdana;">. Sets a <span class="fixed1"><span style="font-family:Verdana;">Dictionary</span></span> object key.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Line</span></b></span><span style="font-family:Verdana;">. Returns the current line number in the <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Name</span></b></span><span style="font-family:Verdana;">. Retrieves or sets a file or folder’s name.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">ParentFolder</span></b></span><span style="font-family:Verdana;">. Retrieves a file or folder’s parent folder object.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Path</span></b></span><span style="font-family:Verdana;">. Retrieves the path associated with a file, folder, or drive.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">RootFolder</span></b></span><span style="font-family:Verdana;">. Retrieves the <span class="fixed1"><span style="font-family:Verdana;">Folder</span></span> object associated with the root folder on the specified drive.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">SerialNumber</span></b></span><span style="font-family:Verdana;">. Retrieves a disk volume’s serial number.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">ShareName</span></b></span><span style="font-family:Verdana;">. Retrieves a network drive’s share name.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">ShortName</span></b></span><span style="font-family:Verdana;">. Retrieves a file’s or folder’s 8.3 character short name.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">ShortPath</span></b></span><span style="font-family:Verdana;">. Retrieves the short path associated with a file’s or folder’s 8.3 character name.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Size</span></b></span><span style="font-family:Verdana;">. Retrieves a file’s or folder’s byte size.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">SubFolders</span></b></span><span style="font-family:Verdana;">. Establishes a <span class="fixed1"><span style="font-family:Verdana;">Folders</span></span> collection consisting of all the folders located inside a specified folder.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">TotalSize</span></b></span><span style="font-family:Verdana;">. Returns the total number of bytes left on a drive.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Type</span></b></span><span style="font-family:Verdana;">. Retrieves information about a file’s or folder’s type.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">VolumeName</span></b></span><span style="font-family:Verdana;">. Retrieves or sets a drive’s volume name.</span></font></p>
<h3><span style="font-size:10pt;font-family:Verdana;">VBScript Runtime Methods</span></h3>
<p><span style="font-family:Verdana;"><font size="2">The methods that belong to the VBScript runtime objects are listed here.</font></span></p>
<p><span style="font-family:Verdana;"></span><font size="2"><b><span style="font-family:Verdana;">VBScript Run-time Methods</span></b><span style="font-family:Verdana;"> </span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Add (Dictionary)</span></b></span><span style="font-family:Verdana;">. Adds a key and item pair to a <span class="fixed1"><span style="font-family:Verdana;">Dictionary</span></span> object.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Add (Folders)</span></b></span><span style="font-family:Verdana;">. Adds a <span class="fixed1"><span style="font-family:Verdana;">Folder</span></span> to a collection.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">BuildPath</span></b></span><span style="font-family:Verdana;">. Appends a name to the path.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Close</span></b></span><span style="font-family:Verdana;">. Closes an open <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Copy</span></b></span><span style="font-family:Verdana;">. Copies a file or folder.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">CopyFile</span></b></span><span style="font-family:Verdana;">. Copies one or more files.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">CopyFolder</span></b></span><span style="font-family:Verdana;">. Recursively copies a folder.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">CreateFolder</span></b></span><span style="font-family:Verdana;">. Creates a new folder.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">CreateTextFile</span></b></span><span style="font-family:Verdana;">. Creates a file and a <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> object that can be used to read and write to the file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Delete</span></b></span><span style="font-family:Verdana;">. Deletes a file or folder.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">DeleteFile</span></b></span><span style="font-family:Verdana;">. Deletes a file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">DeleteFolder</span></b></span><span style="font-family:Verdana;">. Deletes a folder’s contents.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">DriveExists</span></b></span><span style="font-family:Verdana;">. Returns either <span class="fixed1"><span style="font-family:Verdana;">true</span></span> or <span class="fixed1"><span style="font-family:Verdana;">false</span></span> depending on the existence of a drive.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Exists</span></b></span><span style="font-family:Verdana;">. Returns either <span class="fixed1"><span style="font-family:Verdana;">true</span></span> or <span class="fixed1"><span style="font-family:Verdana;">false</span></span> depending on whether a key exists in a <span class="fixed1"><span style="font-family:Verdana;">Dictionary</span></span> object. </span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">FileExists</span></b></span><span style="font-family:Verdana;">. Returns either <span class="fixed1"><span style="font-family:Verdana;">true</span></span> or <span class="fixed1"><span style="font-family:Verdana;">false</span></span> depending on whether a file can be found.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">FolderExists</span></b></span><span style="font-family:Verdana;">. Returns a value of <span class="fixed1"><span style="font-family:Verdana;">true</span></span> or <span class="fixed1"><span style="font-family:Verdana;">false</span></span> depending on whether a folder can be found.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetAbsolutePathName</span></b></span><span style="font-family:Verdana;">. Returns a complete path name.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetBaseName</span></b></span><span style="font-family:Verdana;">. Retrieves a filename less its file extension.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetDrive</span></b></span><span style="font-family:Verdana;">. Returns the <span class="fixed1"><span style="font-family:Verdana;">Drive</span></span> object associated with the drive in the specified path.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetDriveName</span></b></span><span style="font-family:Verdana;">. Retrieves the name of a drive.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetExtensionName</span></b></span><span style="font-family:Verdana;">. Retrieves a file’s extension.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetFile</span></b></span><span style="font-family:Verdana;">. Retrieves a <span class="fixed1"><span style="font-family:Verdana;">File</span></span> object.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetFileName</span></b></span><span style="font-family:Verdana;">. Retrieves the last filename or folder of the specified path.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetFileVersion</span></b></span><span style="font-family:Verdana;">. Retrieves a file’s version number.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetFolder</span></b></span><span style="font-family:Verdana;">. Retrieves the <span class="fixed1"><span style="font-family:Verdana;">Folder</span></span> object associated with the folder in the specified path.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetParentFolderName</span></b></span><span style="font-family:Verdana;">. Retrieves the name of the parent folder.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetSpecialFolder</span></b></span><span style="font-family:Verdana;">. Retrieves a special folder’s name.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">GetTempName</span></b></span><span style="font-family:Verdana;">. Retrieves the name of a temporary file or folder.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Items</span></b></span><span style="font-family:Verdana;">. Returns an array containing the items in a Dictionary object.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Keys</span></b></span><span style="font-family:Verdana;">. Returns an array containing the keys in a Dictionary object.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Move</span></b></span><span style="font-family:Verdana;">. Moves a file or folder.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">MoveFile</span></b></span><span style="font-family:Verdana;">. Moves one or more files.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">MoveFolder</span></b></span><span style="font-family:Verdana;">. Moves one or more folders.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">OpenAsTextStream</span></b></span><span style="font-family:Verdana;">. Opens a file and returns a <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> object that can be used to reference the file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">OpenTextFile</span></b></span><span style="font-family:Verdana;">. Opens a file and returns a <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> object that can be used to reference the file. </span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Read</span></b></span><span style="font-family:Verdana;">. Returns a string containing <span class="fixed1"><span style="font-family:Verdana;">x</span></span> number of characters from a <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">ReadAll</span></b></span><span style="font-family:Verdana;">. Reads the whole <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file and returns its contents.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">ReadLine</span></b></span><span style="font-family:Verdana;">. Reads a line in a <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Remove</span></b></span><span style="font-family:Verdana;">. Deletes a <span class="fixed1"><span style="font-family:Verdana;">Dictionary</span></span> object’s key, item pair.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Skip</span></b></span><span style="font-family:Verdana;">. Skips <span class="fixed1"><span style="font-family:Verdana;">x</span></span> number of character positions when processing a <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">SkipLine</span></b></span><span style="font-family:Verdana;">. Skips a line when processing a <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Write</span></b></span><span style="font-family:Verdana;">. Places a string in the <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">WriteBlankLines</span></b></span><span style="font-family:Verdana;">. Writes <span class="fixed1"><span style="font-family:Verdana;">x</span></span> number of <span class="fixed1"><span style="font-family:Verdana;">newline</span></span> characters to the <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">WriteLine</span></b></span><span style="font-family:Verdana;">. Writes a string in the <span class="fixed1"><span style="font-family:Verdana;">TextStream</span></span> file</span></font></p>
<p align="right"><a href="http://kuldeepse.wordpress.com/2008/02/05/9-scripting-related-to-file-system/"><font color="#000044">Next Step &#8211; File Scripting</font></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kuldeepse.wordpress.com/123/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kuldeepse.wordpress.com/123/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuldeepse.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuldeepse.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kuldeepse.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kuldeepse.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kuldeepse.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kuldeepse.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kuldeepse.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kuldeepse.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kuldeepse.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kuldeepse.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kuldeepse.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kuldeepse.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kuldeepse.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kuldeepse.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=123&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuldeepse.wordpress.com/2008/02/05/8-files-and-folders-related-functions/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b37d5959686c283f564079068ff8246f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kuldeep</media:title>
		</media:content>
	</item>
		<item>
		<title>7:Pop-Up Dialogs</title>
		<link>http://kuldeepse.wordpress.com/2008/02/05/7pop-up-dialogs/</link>
		<comments>http://kuldeepse.wordpress.com/2008/02/05/7pop-up-dialogs/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 08:29:40 +0000</pubDate>
		<dc:creator>kuldeep kumar</dc:creator>
				<category><![CDATA[Learn VBScript for QTP (Descriptive Programming)]]></category>

		<guid isPermaLink="false">http://kuldeepse.wordpress.com/?p=122</guid>
		<description><![CDATA[VBScript Pop-Up Dialogs VBScript provides two built-in functions that allow you to add pop-up dialogs that you can use in your VBScripts to communicate with users. You can call on these functions to execute within your scripts just like you would any function that you wrote yourself.These two functions are available regardless of whether you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=122&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-size:10pt;font-family:Verdana;">VBScript Pop-Up Dialogs</span><br />
</strong><span style="font-family:Verdana;"><font size="2">VBScript provides two built-in functions that allow you to add pop-up dialogs that you can use in your VBScripts to communicate with users. You can call on these functions to execute within your scripts just like you would any function that you wrote yourself.</font></span><span style="font-family:Verdana;"><font size="2">These two functions are available regardless of whether you are embedding your VBScripts into <span class="fixed1"><span style="font-family:Verdana;">HTML</span></span> pages or writing WSH scripts. Both of these functions are described here.</font></span><span style="font-family:Verdana;"><font size="2"> </font></span><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">MsgBox()</span></b></span><span style="font-family:Verdana;">. A procedure that executes and then returns a result to the statement that called it.</span></font><br />
<span style="font-family:Symbol;"><span><font size="2">·</font><span style="font:7pt 'Times New Roman';">         </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">InputBox()</span></b></span><span style="font-family:Verdana;">. A procedure that executes but that does not return a result.</span></font></p>
<h4><span style="font-size:10pt;font-family:Verdana;">The VBScript MsgBox Function</span></h4>
<p><span style="font-family:Verdana;"><font size="2">The <span class="fixed1"><span style="font-family:Verdana;">MsgBox</span></span> function provides a way for you to display a pop-up dialog and ask the user to respond by clicking the appropriate button. The syntax of the <span class="fixed1"><span style="font-family:Verdana;">MsgBox</span></span> function is shown here. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">MsgBox(<i>prompt</i> [, <i>buttons</i>] [, <i>title</i>] [, <i>helpfile</i>, <i>context</i>])</font></span></b></pre>
<p><font size="2"><span class="fixed1"><span style="font-family:Verdana;">Prompt</span></span><span style="font-family:Verdana;"> is the text message displayed by the dialog and can be as many as 1,024 characters long. <span class="fixed1"><span style="font-family:Verdana;">Button</span></span> is a numeric expression or value that is the sum of a number of other values that specify.</span></font><span style="font-family:Wingdings;"><br />
<span><font size="2">§</font><span style="font:7pt 'Times New Roman';">                    </span></span></span><span style="font-family:Verdana;"><font size="2">The types of buttons to display</font></span><span style="font-family:Wingdings;"><br />
<span><font size="2">§</font><span style="font:7pt 'Times New Roman';">                    </span></span></span><span style="font-family:Verdana;"><font size="2">The type of icon to be displayed in the dialog</font></span><span style="font-family:Wingdings;"><br />
<span><font size="2">§</font><span style="font:7pt 'Times New Roman';">                    </span></span></span><span style="font-family:Verdana;"><font size="2">The button to be selected by default</font></span><span style="font-family:Wingdings;"><br />
<span><font size="2">§</font><span style="font:7pt 'Times New Roman';">                    </span></span></span><span style="font-family:Verdana;"><font size="2">The modality of the dialog</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Option Explicit</font></span></b> 

<b><span style="font-family:Verdana;"><font size="2">Dim myResponse</font></span></b> 

<b><span style="font-family:Verdana;"><font size="2">myResponse = MsgBox("Do you wish to quit?", 1, "What do you wish to do?")</font></span></b></pre>
<h4><span style="font-size:10pt;font-family:Verdana;">The VBScript InputBox Function</span></h4>
<p><span style="font-family:Verdana;"><font size="2">The <span class="fixed1"><span style="font-family:Verdana;">InputBox()</span></span> function provides a way for you to display a pop-up dialog that prompts the user to supply text input. The <span class="fixed1"><span style="font-family:Verdana;">InputBox</span></span> allows you to ask the user questions and collect text input. The syntax of the <span class="fixed1"><span style="font-family:Verdana;">InputBox()</span></span> function is shown here. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">InputBox(<i>prompt</i> [, <i>title</i>] [, <i>default</i>] [, <i>xpos</i>] [, <i>ypos</i>] [, <i>helpfile</i>, <i>context</i>])</font><a name="164" title="164"></a><a name="beginpage.0ED57D5D-E341-4833-BA2F-5ABD74" title="beginpage.0ED57D5D-E341-4833-BA2F-5ABD74"></a></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">For example, the following statements prompt the user to type the name of the country in which he or she resides.</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Option Explicit</font></span></b><b><span style="font-family:Verdana;"><font size="2">Dim myInput</font></span></b> 

<b><span style="font-family:Verdana;"><font size="2">myInput = InputBox("What country do you reside in?")</font></span></b></pre>
<p align="right"><a href="http://kuldeepse.wordpress.com/2008/02/05/8-files-and-folders-related-functions/"><font color="#000044">Next Step &#8211; File and Folder Functions</font></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kuldeepse.wordpress.com/122/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kuldeepse.wordpress.com/122/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuldeepse.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuldeepse.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kuldeepse.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kuldeepse.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kuldeepse.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kuldeepse.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kuldeepse.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kuldeepse.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kuldeepse.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kuldeepse.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kuldeepse.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kuldeepse.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kuldeepse.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kuldeepse.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=122&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuldeepse.wordpress.com/2008/02/05/7pop-up-dialogs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b37d5959686c283f564079068ff8246f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kuldeep</media:title>
		</media:content>
	</item>
		<item>
		<title>6: Arrays</title>
		<link>http://kuldeepse.wordpress.com/2008/02/05/6-arrays/</link>
		<comments>http://kuldeepse.wordpress.com/2008/02/05/6-arrays/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 08:26:27 +0000</pubDate>
		<dc:creator>kuldeep kumar</dc:creator>
				<category><![CDATA[Learn VBScript for QTP (Descriptive Programming)]]></category>

		<guid isPermaLink="false">http://kuldeepse.wordpress.com/2008/02/05/6-arrays/</guid>
		<description><![CDATA[Arrays VBScript allows you to store data in variables that you can then reference and manipulate. While there is no limit to the number of variables that you can create in a single VBScript, you’ll find that trying to manage too many of them can become difficult.VBScript provides another storage structure for managing large groups [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=121&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><b><u><span style="font-family:Verdana;"><font size="2">Arrays</font></span></u></b><br />
<span style="font-family:Verdana;"><font size="2">VBScript allows you to store data in variables that you can then reference and manipulate. While there is no limit to the number of variables that you can create in a single VBScript, you’ll find that trying to manage too many of them can become difficult.</font></span><span style="font-family:Verdana;"><font size="2">VBScript provides another storage structure for managing large groups of related data known as an array. An <i>array</i> is an indexed collection of values that are managed as a unit. For example, rather than creating a whole series of individual variables to store a list of values such as people’s names, you can create an array and assign each name as an array element.</font></span><span style="font-family:Verdana;"><font size="2">VBScript supports the creation of single dimensional and multidimensional arrays. In fact, VBScript allows for the creation of arrays with as many as 60 dimensions, although you’ll probably never need to work with anything bigger than one or two dimensions.</font></span><span style="font-family:Verdana;"><font size="2">VBScript allows you to create an array using the <span class="fixed1"><span style="font-family:Verdana;">Dim</span></span> statement. The syntax of the <span class="fixed1"><span style="font-family:Verdana;">Dim</span></span> statement when used to establish an array is </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2"> </font></span></b> <b><span style="font-family:Verdana;"><font size="2">Dim <i>arrayname</i>(<i>dimensions</i>)</font></span></b></pre>
<p><font size="2"><span class="fixed1"><span style="font-family:Verdana;">Dimensions</span></span><span style="font-family:Verdana;"> is a comma-separated list specifying the length of each of an array’s dimensions. For example, the following statement defines a single dimension array called <span class="fixed1"><span style="font-family:Verdana;">myArray</span></span> that can hold up to four elements. </span></font></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Dim myArray(2)</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">An array is an indexed list. The first value stored in the array is automatically assigned an index value 0. The second element stored in an array has an index value of 1, and so on. Because an array’s index always begins with zero the actual length of an array dimension is equal to the number supplied in the declaration statement plus one. So the array defined above can hold up to 4 elements.</font></span><span style="font-family:Verdana;"><font size="2">Once you have defined and array you can populate it as demonstrated here.</font><font size="2"> </font></span></p>
<pre>
<b><span style="font-family:Verdana;"><font size="2">myArray(0) = "Welcome"</font></span></b><b><span style="font-family:Verdana;"><font size="2">myArray(1) = "To"</font></span></b>  

<b><span style="font-family:Verdana;"><font size="2">myArray(2) = "KR Testing Solution"</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">After you have populated an array you can reference its contents. For example, you could use the following statement to display the value stored as the third element in the array.</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">WScript.Echo myArray(2)</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">The following examples show how to create an array with more than one dimension. In this case, a two-dimensional array is created using the <span class="fixed1"><span style="font-family:Verdana;">Dim</span></span> statement that can store its data in a spreadsheet like format. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Dim myArray (4,4)</font></span></b></pre>
<p><span style="font-family:Verdana;"><font size="2">You can think of the array created by this example as having five rows by five columns. Remember, the length of any array dimension equals 1 plus the value that specified its length. Similarly, your could define a three-dimensional array by adding additional comma separated values in the <span class="fixed1"><span style="font-family:Verdana;">Dim</span></span> statement as shown here. </font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">Dim myArray (4,4,4)</font></span></b></pre>
<p align="right"><a href="http://kuldeepse.wordpress.com/2008/02/05/7pop-up-dialogs/"><font color="#000044">Next Step &#8211; Message Dialogs</font></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kuldeepse.wordpress.com/121/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kuldeepse.wordpress.com/121/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuldeepse.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuldeepse.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kuldeepse.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kuldeepse.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kuldeepse.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kuldeepse.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kuldeepse.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kuldeepse.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kuldeepse.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kuldeepse.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kuldeepse.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kuldeepse.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kuldeepse.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kuldeepse.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=121&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuldeepse.wordpress.com/2008/02/05/6-arrays/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b37d5959686c283f564079068ff8246f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kuldeep</media:title>
		</media:content>
	</item>
		<item>
		<title>5: Functions</title>
		<link>http://kuldeepse.wordpress.com/2008/02/05/5-functions/</link>
		<comments>http://kuldeepse.wordpress.com/2008/02/05/5-functions/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 08:24:28 +0000</pubDate>
		<dc:creator>kuldeep kumar</dc:creator>
				<category><![CDATA[Learn VBScript for QTP (Descriptive Programming)]]></category>

		<guid isPermaLink="false">http://kuldeepse.wordpress.com/?p=120</guid>
		<description><![CDATA[Functions VBScript provides two different types of procedures. §                    Function. A procedure that executes and then returns a result to the statement that called it. §                    Subroutine. A procedure that executes but does not return a result. Functions VBScript functions are collections of related VBScript statements that are called and executed as a unit. Functions [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=120&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="font-size:10pt;font-family:Verdana;">Functions </span><br />
</strong><span style="font-family:Verdana;"><font size="2">VBScript provides two different types of procedures.</font></span><br />
<span style="font-family:Wingdings;"><span><font size="2">§</font><span style="font:7pt 'Times New Roman';">                    </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Function</span></b></span><span style="font-family:Verdana;">. A procedure that executes and then returns a result to the statement that called it.</span></font><br />
<span style="font-family:Wingdings;"><span><font size="2">§</font><span style="font:7pt 'Times New Roman';">                    </span></span></span><font size="2"><span class="fixed1"><b><span style="font-family:Verdana;">Subroutine</span></b></span><span style="font-family:Verdana;">. A procedure that executes but does not return a result.</span></font></p>
<h4><span style="font-size:10pt;font-family:Verdana;">Functions</span></h4>
<p><span style="font-family:Verdana;"><font size="2">VBScript functions are collections of related VBScript statements that are called and executed as a unit. Functions can also return a result to calling statements. The syntax for creating a function is</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">[Public | Private] Function <i>name</i> [(<i>arglist</i>)]</font></span></b> <b><span style="font-family:Verdana;"><font size="2"> <i>statements</i></font></span></b> <b><span style="font-family:Verdana;"><font size="2">End Function</font></span></b></pre>
<p><font size="2"><span class="fixed1"><span style="font-family:Verdana;">Private</span></span><span style="font-family:Verdana;"> and <span class="fixed1"><span style="font-family:Verdana;">Public</span></span> are optional keywords. The <span class="fixed1"><span style="font-family:Verdana;">Private</span></span> keyword is used to set up a function that can only be called from within the script where it has been defined. When used, the <span class="fixed1"><span style="font-family:Verdana;">Public</span></span> keyword allows the function to be called by other scripts. <span class="fixed1"><span style="font-family:Verdana;">Name</span></span> identifies the function’s name. <span class="fixed1"><span style="font-family:Verdana;">Arglist</span></span> is used to specify one or more arguments that that can be passed to the function.</span></font><span style="font-family:Verdana;"><font size="2">To return a result to the statement that called the functions you must be sure that the subroutine has a variable of the same name as the subroutine. </font><a name="137" title="137"></a><a name="beginpage.DC1C7E1F-7D1B-44EA-A11A-AAE514" title="beginpage.DC1C7E1F-7D1B-44EA-A11A-AAE514"></a></span><span style="font-family:Verdana;"><font size="2">The value that the subroutine assigned to this variable is what will be returned.</font></span><span style="font-family:Verdana;"><font size="2">The following example shows a WSH VBScript that has two functions.</font></span></p>
<pre>
<b><span style="font-family:Verdana;"><font size="2">' * Script Name:<span>   </span>Script 3.vbs</font></span></b><b><span style="font-family:Verdana;"><font size="2">Option Explicit</font></span></b></pre>
<p><b><span style="font-family:Verdana;"><font size="2">Const Message = &#8220;Welcome to KR Testing Solutions&#8221;</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">Dim string1</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">Dim string2</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">&#8216; *********** Main processing section ****************</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">&#8216; Collect the First String</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">string1 = GetFirstString()</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">&#8216; Collect the Second String</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">string2 = GetSecondString()</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">&#8216; Display message</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">WScript.Echo Message &amp; &#8221; &#8221; &amp; string1 &amp; &#8221; &#8221; &amp; string2</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">&#8216; ********* Subroutines &amp; Functions go here **********</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">function GetFirstString()</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">GetFirstString = InputBox(&#8220;What is your 1<sup>st</sup> String?&#8221;)</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">End Function</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2"></font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">function GetSecondString()</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">GetSecondString = InputBox(&#8220;What is your 2<sup>nd</sup> String?&#8221;)</font></span></b><br />
<b><span style="font-family:Verdana;"><font size="2">End Function</font></span></b></p>
<h4><span style="font-size:10pt;font-family:Verdana;">Subroutines</span></h4>
<p><span style="font-family:Verdana;"><font size="2">Subroutines work almost exactly like functions except that they are unable to return any results to the calling statement. The syntax for creating a subroutine is shown here.</font></span></p>
<pre><b><span style="font-family:Verdana;"><font size="2">[Public | Private] Sub <i>name</i> [(<i>arglist</i>)]</font></span></b> <b><span style="font-family:Verdana;"><font size="2"> <i>statements</i></font></span></b> <b><span style="font-family:Verdana;"><font size="2">End Sub</font></span></b></pre>
<p align="right"><a href="http://kuldeepse.wordpress.com/2008/02/05/6-Arrays/"><font color="#000044">Next Step &#8211; Array Decleration</font></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/kuldeepse.wordpress.com/120/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/kuldeepse.wordpress.com/120/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuldeepse.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuldeepse.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/kuldeepse.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/kuldeepse.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/kuldeepse.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/kuldeepse.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/kuldeepse.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/kuldeepse.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/kuldeepse.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/kuldeepse.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/kuldeepse.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/kuldeepse.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/kuldeepse.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/kuldeepse.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuldeepse.wordpress.com&amp;blog=805460&amp;post=120&amp;subd=kuldeepse&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuldeepse.wordpress.com/2008/02/05/5-functions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/b37d5959686c283f564079068ff8246f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kuldeep</media:title>
		</media:content>
	</item>
	</channel>
</rss>
