GetTempPath API in Javascript

How can find a temp folder where the current user has the access right?
My application will generate template html files in a temp folder under the application path (usually, administrator user installed it in "C:\Program Files\BillcchApp"), but some of users don't have the access right on the application folder. How can I find the path that current user has the access right....

Thanks
billcchAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

devicCommented:
>>>My application will generate template html files...
did your write this app?
If yes, why not GetTempPath from this app?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ZvonkoSystems architectCommented:
Here an example:

<script>
function getTempDir(){
  var wShell = new ActiveXObject("WScript.Shell")
  var wEnv = wShell.Environment("Process");
  var tPath = wEnv("TEMP")
  if(tPath==""){
    tPath = wEnv("TMP")
  }
  return tPath;
}

alert(getTempDir());
</script>

0
devicCommented:
"Automation server can't create object"

for this reason I didn't write example, but the same thing easy to do in app.

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ZvonkoSystems architectCommented:
Where do you read it is a web page? It only creates web pages.
0
devicCommented:
I didn't read it, but I did understand it so :)
and your example for some reason has <script> ;)
0
devicCommented:
ok, If some hta is billcch's application, then Zvonko's example is ok.
but if we speak about scripts that are not on the webpage, then I prefer .vbs

----------------test.vbs-------------------------------

Set WSHShell = CreateObject("WScript.Shell")  
Set Environ = WSHShell.Environment  

For Each i In Environ
      Environs = Environs & i & vbCrlf
Next

MsgBox "HERE ALL ENVIRONS" & vbCrlf & Environs

-----------------------------------------------------------
0
billcchAuthor Commented:
Thanks guy,
sorry I went to business trip, and did not have chance back to ee to thanks you guys.
Thanks again!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.