title: ORA-12546: TNS:permission denied, on Windows through Task Sheduler
body: <p>I am trying to export all objects of specific oracle user by executing a batch file through Windows Task Sheduler:</p>
  
  <pre><code>exp.exe user/pass@dbname owner=user log=mylog.txt
  </code></pre>
  
  <p>The Oracle 11.2.0.4 x64 and the database are on that same Windows7 machine</p>
  
  <p>The task starts OK. That is to mean that no wrong user or password issues are there. But when task is started by schedule, it says in the log:</p>
  
  <blockquote>
    <p>ORA-12546: TNS:permission denied</p>
  </blockquote>
  
  <p>When task is started manually, under same user as the scheduled user (this user is member of <code>Administrators</code> group and <code>ora_dba</code> group, by the way), it works fine and export is done. The task is scheduled with an <code>Execute with highest privileges</code> checkbox in task properties, so I don't see why there is a difference between the "by schedule" and "manual" task start.</p>
  
  <p>I've read a lot on <code>ORA-12546: TNS:permission denied</code> on this site, but all topics are concerning Linux. I tried to set permissions on c:\app\oracle, where my Oracle is installed. Actually, <code>Administrators</code> already by default had all permissions on that directory</p>
  
  <p>I noticed that export of tables, however, works fine even in the task started by schedule:</p>
  
  <pre><code>exp.exe user/pass@dbname tables=mytable1,mytable2 log=mylog.txt
  </code></pre>
  
  <p>At any rate, the oracle user <code>user</code> has oracle rights to export entire database.</p>
  
  <p><strong>Problem:</strong></p>
  
  <p>Only-tables are exported fine, but with <code>owner=</code> export key I get <code>TNS:permission denied</code>, and only if Windows scheduled task is started by schedule, while manually started task does everything OK.</p>