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.
Sub TestVBS()
Dim sFileName As String, s As String, wshShell As Object
sFileName = "H:\testmsgbox.vbs"
' Run Visual Basic Script file
Set wshShell = CreateObject("Wscript.Shell")
s = wshShell.Run("""" & sFileName & """", 1, True)
Set wshShell = Nothing
End Sub
Code within testmsgbox.vbs file
Bookmarks