+ Reply to Thread
Results 1 to 4 of 4

Using Wscript.Shell to execute VBS script gives Permission denied Error 70

  1. #1
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Using Wscript.Shell to execute VBS script gives Permission denied Error 70

    When executing the below code (TestVBS) gives Permission Denied Runtime Error 70.
    This script below has been simplified for testing, but this method use to work just fine (for many uses).
    I can double-click the testmsgbox.vbs and it executes OK.
    I have located the vbs file in C or H drive where no file access permission would be an issue.

    I would appreciate help or solution to this issue.
    Thanks in advance.

    Please Login or Register  to view this content.

    Code within testmsgbox.vbs file
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Using Wscript.Shell to execute VBS script gives Permission denied Error 70

    Hello wotadue,

    Rather than using the Windows Script Host, I prefer to use the ShellExecute command because it is more reliable.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    255

    Re: Using Wscript.Shell to execute VBS script gives Permission denied Error 70

    Hi Leith, it's been a while since I have needed to use this forum. And you have helped me a number of times, some years back.
    So good to see you are still on the team here.

    I have run your code, but without success. ret returns a 5.
    So presumably this is "The operating system denied access to the specified file."
    So do not understand why this would be the case. I have located the vbs file on C or H drives (my local drives) without success.

    What else do you think is the cause/solution ?
    Thanks, appreciate your help.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Using Wscript.Shell to execute VBS script gives Permission denied Error 70

    Hello wotadude,

    Probably because your account does not have Administrator rights.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. WScript.Shell error 'Outside Procedure'
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2017, 06:43 AM
  2. How to fix runtime error 70 permission denied ?
    By TR16238 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-05-2017, 02:13 AM
  3. How to fix runtime error 70 permission denied ?
    By TR16238 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-05-2017, 02:11 AM
  4. How to fix runtime error 70 permission denied ?
    By TR16238 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 01-05-2017, 02:09 AM
  5. RunTime 70 Error - Permission Denied
    By ross88guy in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-27-2011, 04:46 AM
  6. [SOLVED] using WScript.CreateObject("Wscript.Shell
    By John Keith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-30-2005, 02:20 PM
  7. [SOLVED] error 70 - Permission denied
    By MT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2005, 03:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1