<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How Can I Determine if a File Exists and, if It Does, Exit the Script?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/06/20/how-can-i-determine-if-a-file-exists-and-if-it-does-exit-the-script.aspx</link><description>Hey, Scripting Guy! How can I check to see if a particular file exists and, if it does, exit the script? -- TO 
 Hey, TO. There are at least two ways to check for the existence of a file (that’s the real key here; exiting the script is easy). One of</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: How Can I Determine if a File Exists and, if It Does, Exit the Script?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/06/20/how-can-i-determine-if-a-file-exists-and-if-it-does-exit-the-script.aspx#3514503</link><pubDate>Wed, 15 Aug 2012 14:40:14 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3514503</guid><dc:creator>jrv</dc:creator><description>&lt;p&gt;This will retrieve all files named &amp;#39;test&amp;#39; anywhere on the computer.&lt;/p&gt;
&lt;p&gt;Set colFiles = objWMIService.ExecQuery _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;(&amp;quot;Select * From CIM_Datafile Where FileName = &amp;#39;Test&amp;#39;&amp;quot;)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3514503" width="1" height="1"&gt;</description></item><item><title>re: How Can I Determine if a File Exists and, if It Does, Exit the Script?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/06/20/how-can-i-determine-if-a-file-exists-and-if-it-does-exit-the-script.aspx#3514494</link><pubDate>Wed, 15 Aug 2012 13:41:50 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3514494</guid><dc:creator>Kay</dc:creator><description>&lt;p&gt;But what if you only know the name of the file and not the path to it. I need to write a script that tells me if the file exists anywhere on the computer, not simply in C:\Scripts.. can that be done?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3514494" width="1" height="1"&gt;</description></item></channel></rss>