<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: scripted input batch script cant access files in same dir in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/scripted-input-batch-script-cant-access-files-in-same-dir/m-p/23476#M3685</link>
    <description>&lt;P&gt;Awesome! Could you please mark my answer as accepted? Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2011 21:02:59 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2011-11-28T21:02:59Z</dc:date>
    <item>
      <title>scripted input batch script cant access files in same dir</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/scripted-input-batch-script-cant-access-files-in-same-dir/m-p/23473#M3682</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;My Windows batch script executes a bin file and uses a text file to hold the state of the last execution, all the necessary files are in the same directory. When I test it from the command line it works fine, but when the script handler runs it it can't read any of the files.&lt;BR /&gt;
I placed my files in &lt;CODE&gt;"C:\Program Files\Splunk\bin\scripts\customdir"&lt;/CODE&gt;.&lt;BR /&gt;
Can anyone help me out?&lt;/P&gt;

&lt;P&gt;Thanks for any help,&lt;/P&gt;

&lt;P&gt;Rui&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 19:17:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/scripted-input-batch-script-cant-access-files-in-same-dir/m-p/23473#M3682</guid>
      <dc:creator>rlourenco</dc:creator>
      <dc:date>2011-11-28T19:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: scripted input batch script cant access files in same dir</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/scripted-input-batch-script-cant-access-files-in-same-dir/m-p/23474#M3683</link>
      <description>&lt;P&gt;The scripts don't run with the script's directory as the working directory. I don't remember which directory is used on Windows (maybe %TEMP%?) but running &lt;CODE&gt;cd&lt;/CODE&gt; in your script and check what it outputs should give you the answer you need to that question.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 19:27:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/scripted-input-batch-script-cant-access-files-in-same-dir/m-p/23474#M3683</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-11-28T19:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: scripted input batch script cant access files in same dir</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/scripted-input-batch-script-cant-access-files-in-same-dir/m-p/23475#M3684</link>
      <description>&lt;P&gt;Thanks! I didn't think of doing that!&lt;/P&gt;

&lt;P&gt;Running "@echo Current dir %CD%" showed it was running under C:\WINDOWS\system32, so then I added a CD &lt;WORKING directoy=""&gt; to the beginning of my script to change to the working directory.&lt;/WORKING&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 20:04:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/scripted-input-batch-script-cant-access-files-in-same-dir/m-p/23475#M3684</guid>
      <dc:creator>rlourenco</dc:creator>
      <dc:date>2011-11-28T20:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: scripted input batch script cant access files in same dir</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/scripted-input-batch-script-cant-access-files-in-same-dir/m-p/23476#M3685</link>
      <description>&lt;P&gt;Awesome! Could you please mark my answer as accepted? Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 21:02:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/scripted-input-batch-script-cant-access-files-in-same-dir/m-p/23476#M3685</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-11-28T21:02:59Z</dc:date>
    </item>
  </channel>
</rss>

