Permission Denied error in vbscript while running wshShell


Permission Denied error in vbscript while running wshShell



I have a code to make delay in execution which is written in vbscript but when I run this code error with Permission Denied is occurring every time. The error code is 800a0046 and the code which generates this error is as below.


800a0046


Sub Delay( seconds )
Dim wshShell, strCmd
Set wshShell = CreateObject( "WScript.Shell" )
strCmd = wshShell.ExpandEnvironmentStrings( "%COMSPEC% /C (PING.EXE -n " & ( seconds + 1 ) & " localhost >NUL 2>&1)" )
wshShell.Run strCmd, 0, 1
Set wshShell = Nothing
End Sub



on the forth line it throws the error


Microsoft VBScript runtime error '800a0046'
Permission denied



can anybody please provide a solution to how and where to set the required permission.





How did you test it on your side ?. For me works ! with vbscript !
– Hackoo
Jul 3 at 7:33






It works at my end as well but on other environment, consider as production it doesn't works
– Audumbar
Jul 3 at 8:57





Possible duplicate of How to debug ASP permission problems with WScript.Shell object?
– Shadow Wizard
Jul 3 at 13:56









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

How to set up datasource with Spring for HikariCP?

PHP contact form sending but not receiving emails