# [SOLVED] Windows Script Host, Permission denied, Microsoft JScript runtime error



## geoffrey (Apr 1, 2008)

Dear All,

I would like to install the program Treefinder (http://www.treefinder.de/) to a notebook with Windows Vista Home Premium. The installation script is in a file "install.js":

-------
var WSHShell = WScript.CreateObject("WScript.Shell");

var path = WScript.ScriptFullName;
var tfdir = path.substr(0,path.lastIndexOf("\\"));

var env = WSHShell.Environment("SYSTEM");
env.Item( "TFDIR" ) = tfdir;

var shortcut = WSHShell.CreateShortcut(tfdir + "\\-TREEFINDER-.lnk");
shortcut.TargetPath = tfdir + "\\treefinder.js";
shortcut.WorkingDirectory = "";
shortcut.WindowStyle = 4;
shortcut.IconLocation = tfdir + "\\icon32.ico";
shortcut.Save();
-------

The machine has:
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing).

If I double click "install.js", I get the error message:

---------------------------
Windows Script Host
---------------------------
Script:	C:\Program Files\Treefinder v.03.2008\install.js
Line:	8
Char:	1
Error:	Permission denied
Code:	800A0046
Source: Microsoft JScript runtime error

---------------------------

Perhaps this "permission" error is easy to correct, but I do not know how to go about it. I thought it might have been connected with the Windows Security Center Firewall, but if I disabled the firewall and immediately tried install.js, I got the same error.

I would be grateful for suggestions--including a different place to take this request, if this is not a good place for it--and I will be glad to provide additional details. I can check in here and post back around this time of day.

Geoff.


----------



## chauffeur2 (Feb 7, 2006)

*Re: Windows Script Host, Permission denied, Microsoft JScript runtime error*

Hi Geoff, Welcome to TSF! :4-wave:

Vista being Vista, can be very cantankerous at times. :laugh:

I use *this little utility* _(Click the coloured link)_ to over these situations....give it a try and post back with the results.

Kind Regards,


----------



## geoffrey (Apr 1, 2008)

*Re: Windows Script Host, Permission denied, Microsoft JScript runtime error*

chauffeur2: Problem solved! Thank you for such an immediate, concise, and effective reply. Using TweakUAC to adjust the UAC to quiet mode issued the same error. Switching UAC off enabled installation. Strange, to me: I never would have guessed it was a "UAC" problem. I wasted loads of time trying to find an answer via microsoft's website. Here, the answer came in just 6 minutes. Remarkable.

Best wishes to chauffeur2 and colleagues.

Geoff.


----------



## chauffeur2 (Feb 7, 2006)

*Re: Windows Script Host, Permission denied, Microsoft JScript runtime error*

Hi Geoff,
Thanks for the compliment/reply.
I am sincerely pleased that we've got it sorted. :4-clap:
Feel free to post back again should Vista™ ever give you hassles again. :grin:

Kind Regards,


----------

