Script access denied problem 
Author Message
 Script access denied problem

I tried to run this script:

---begin---
thehour = DatePart("h",Now)
theday = DatePart("w",Now)

Set WshShell = WScript.CreateObject("WScript.Shell")
If (theday = 1 or theday = 7) or thehour >= 18 then
 WshShell.Run ("C:\windows\desktop\btinte~2.lnk")
else
 WshShell.Run ("C:\windows\desktop\btinte~1.lnk")
end If
---end---

Saved as CONNECT.vbs

But it complains:

---------------------------
Windows Script Host
---------------------------
Script: C:\connect.vbs
Line:   8
Char:   2
Error:  Permission denied
Code:   800A0046
Source:         Microsoft VBScript runtime error
----------------------------

I see this as failing to run C:\Copy.lnk which exists, and is a shortcut
to a connectoid in dialup networking.  Double clicking Copy.lnk itself
connects.
--
***********************************************************
Midi/mod music, {*filter*}/scenic pictures, funny sound clips:
http://www.*-*-*.com/ ~hucker/pages.htm

A "Frisbeterian" believes that when you die,
your soul goes up on the roof, and you can't get it back down.



Wed, 15 Dec 2004 04:34:21 GMT  
 Script access denied problem
Known problem with specifying the full path. If your shortcuts are in the
same directory as the script (or on the path I guess) this should work.

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "btinte~2.lnk"

Regards,
Ian
WSH FAQ http://www.*-*-*.com/

Quote:
> I tried to run this script:

> ---begin---
> thehour = DatePart("h",Now)
> theday = DatePart("w",Now)

> Set WshShell = WScript.CreateObject("WScript.Shell")
> If (theday = 1 or theday = 7) or thehour >= 18 then
>  WshShell.Run ("C:\windows\desktop\btinte~2.lnk")
> else
>  WshShell.Run ("C:\windows\desktop\btinte~1.lnk")
> end If
> ---end---

> Saved as CONNECT.vbs

> But it complains:

> ---------------------------
> Windows Script Host
> ---------------------------
> Script: C:\connect.vbs
> Line: 8
> Char: 2
> Error: Permission denied
> Code: 800A0046
> Source: Microsoft VBScript runtime error
> ----------------------------

> I see this as failing to run C:\Copy.lnk which exists, and is a shortcut
> to a connectoid in dialup networking.  Double clicking Copy.lnk itself
> connects.
> --
> ***********************************************************
> Midi/mod music, {*filter*}/scenic pictures, funny sound clips:
> http://www.*-*-*.com/ ~hucker/pages.htm

> A "Frisbeterian" believes that when you die,
> your soul goes up on the roof, and you can't get it back down.



Wed, 15 Dec 2004 06:13:58 GMT  
 Script access denied problem

Quote:

> Known problem with specifying the full path. If your shortcuts are in the
> same directory as the script (or on the path I guess) this should work.

> Set WshShell = WScript.CreateObject("WScript.Shell")
> WshShell.Run "btinte~2.lnk"

Alternatively, you can use the shell.application shellExecute method instead to
"run" the link file (Win2k and WinXP only).

Also, you can run the connectoid directly without using a shortcut (lnk) file:


Subject: DUN in Win98
Newsgroups: microsoft.public.scripting.wsh
Date: 2001-06-06 08:52:23 PST
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=69fe06...

--
torgeir



Thu, 23 Dec 2004 01:27:42 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Access Denied error - script debugger problem?

2. "Access denied" when accessing script object

3. access denied when scripting across frames

4. "access denied" on cross domain scripting

5. Access Denied Error when working with frames

6. _Blank and Access is denied

7. "Access denied" on document.LastModified Object

8. Access Denied--Document.Write

9. Access is denied

10. "Access is denied" Error

11. "Access is denied" error

12. Experts Only - URL - Access Denied Error

 

 
Powered by phpBB® Forum Software