<?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 the Path to the Folder Where a Script is Running?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/04/05/how-can-i-determine-the-path-to-the-folder-where-a-script-is-running.aspx</link><description>Hey, Scripting Guy! How can I determine the path to the folder where a script is running? What I’d like to do is have the script automatically open the folder where the script is running. -- PD 
 Hey, PD. You know, for the Scripting Guys this question</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 the Path to the Folder Where a Script is Running?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/04/05/how-can-i-determine-the-path-to-the-folder-where-a-script-is-running.aspx#3534918</link><pubDate>Tue, 27 Nov 2012 12:24:29 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3534918</guid><dc:creator>Eduardo Mozart de Oliveira</dc:creator><description>&lt;p&gt;Thank you! Your post was very useful!&lt;/p&gt;
&lt;p&gt;I think that VBScript is dying to PowerShell, but i really doesn&amp;#39;t like it.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3534918" width="1" height="1"&gt;</description></item><item><title>re: How Can I Determine the Path to the Folder Where a Script is Running?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/04/05/how-can-i-determine-the-path-to-the-folder-where-a-script-is-running.aspx#3453529</link><pubDate>Thu, 15 Sep 2011 17:48:31 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3453529</guid><dc:creator>Rob Guy</dc:creator><description>&lt;p&gt;I know, it&amp;#39;s been hashed out a thousands times in a thousand different places but the simple string replace runs the hazard (however small the possibility) of the script&amp;#39;s name existing elsewhere in the string of the full path and skewing the results. There&amp;#39;s the method shown above (essentially):&lt;/p&gt;
&lt;p&gt;wScript.Echo CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;).GetParentFolderName(Wscript.ScriptFullName)&lt;/p&gt;
&lt;p&gt;or, if you don&amp;#39;t have one handy already or don&amp;#39;t want to create an instance of the Scripting.FileSystemObject you can stick with the string parsing route with:&lt;/p&gt;
&lt;p&gt;wScript.Echo Left(Wscript.ScriptFullName, InStrRev(Wscript.ScriptFullName, &amp;quot;\&amp;quot;))&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3453529" width="1" height="1"&gt;</description></item><item><title>re: How Can I Determine the Path to the Folder Where a Script is Running?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2006/04/05/how-can-i-determine-the-path-to-the-folder-where-a-script-is-running.aspx#3391540</link><pubDate>Thu, 03 Mar 2011 14:06:12 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3391540</guid><dc:creator>Si...</dc:creator><description>&lt;p&gt;It&amp;#39;s easier to use this...&lt;/p&gt;
&lt;p&gt;WScript.echo replace( WScript.ScriptFullName, WScript.ScriptName, &amp;quot;&amp;quot; )&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3391540" width="1" height="1"&gt;</description></item></channel></rss>