HomeWeb Coding

Run .vbs file without Security warning

Like Tweet Pin it Share Share Email

When you try to run/execute a .vbs file, you will be prompted with Security Warning. The security warning is good and it saves your PC from some malicious programs. But its an annoyance when you try to execute your own code.

As VBScript developer you will face this issue a lot when try to Schedule your task. To overcome this Microsoft suggest to set the Environment variable called  SEE_MASK_NOZONECHECKS to 1.

set oShell= CreateObject("Wscript.Shell")
set oEnv = oShell.Environment("PROCESS")
oShell.Run "c:\projects\sample.vbs   /norestart",0,True


Recently tested this code on  Windows 7 64 bit and it worked fine.



Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *