# Solved: Need Help Bypassing "Open File - Security Wanring" Dialog Box



## Eric01 (May 25, 2011)

I wrote a vb script, and I am trying to run it with a batch file.

Everytime the batch file access it, the user must press "Open" to access the script.

This is opposite of what I want, I want it to silently install in the background without any user intervention necessary.

I have the script on a network drive which everyone can access.

I am putting the batch file into everyone's startup folder.

I just need help with the arguments needed to make it automatically accept the risk and open it anyways.

Here is a generic sample of my batch file:

"@echo off 
\\server\share\adlogon_user.vbs /quiet /passive /norestart
exit"


Any help would be greatly appreciated.


----------



## Elvandil (Aug 1, 2003)

What produces the warning? It sounds like it comes from your anti-virus, but you can check in Task Manager to find out.

The file will probably need to be added to the exceptions in the anti-virus programs of every machine that will execute it.


----------



## Eric01 (May 25, 2011)

From everything I have read, it's being caused because of the intranet settings, because it is found over UNCs....

I hope that was helpful for you....


----------



## Elvandil (Aug 1, 2003)

What produces the warning?


----------



## Eric01 (May 25, 2011)

I attached a screen shot of the warning. it is a generic windows security warning.

I have dabbled in programming throughout the years, but I just don't know what to add to the batch file to force this to open.

I wouldn't mind this pop-up occurring if I could make the program open without user interaction.

I appreciate your time and efforts.....


----------



## Squashman (Apr 4, 2003)

Have you tried right clicking the file and selecting Properties. And on the General Tab click the Unblock button and then click apply.


----------



## Eric01 (May 25, 2011)

Yes, I know exactly what you are talking about, that option is not available.

I honestly need some additional piece in my batch file that "presses" the open button.

If anyone knows of any arguments that can be added which will both open the file and press the open button when it opens, that's what I'm looking for.


----------



## Squashman (Apr 4, 2003)

Can't do that in batch. You would need to do it with AutoHotKey or AutoIt.


----------



## Eric01 (May 25, 2011)

well that bites......

I don't want to spend money on any programs just to get this script to work, so I was wondering if it would be possible, at all, to find free versions of those programs (if they aren't free themselves) because I know nothing about the programs you just listed.

I appreciate your help, and any added assistance is also greatly appreciated.


----------



## Squashman (Apr 4, 2003)

AutoHotKey is free I believe and I am pretty sure there are a few people here who use it regularly.


----------



## stantley (May 22, 2005)

Yes, AutoHotkey is free and should be able to do the task. Read through the Quick-start Tutorial to get the basics.

You'd use a Run command to start your vb script.

Then a WinWaitActive command to wait until the Dialog box opens.

Then some Send commands to press the Open button.

Send, {Left}
Send, {Enter}


----------



## Eric01 (May 25, 2011)

That was a great tip, thank you.

Hopefully I can figure that out before Monday. But if anyone has experience with AutoHotKey programming and can help me to open this file, I would greatly appreciate it.

All suggestions are welcome.... as long as they don't involve me telling the users to run it..... lol


----------



## stantley (May 22, 2005)

Eric01 said:


> help me to open this file


If you mean open the vb script it would be

Run, full path\adlogon_user.vbs

Just plug in the full path.


----------



## Eric01 (May 25, 2011)

lol, no, I have that part down....

I mean when I run that portion, it opens the script, but a warning dialog opens up, with two options, "open" or "cancel" and I want the script to select the option to "open"


----------



## stantley (May 22, 2005)

When that dialog box comes up it looks like the default is "Cancel". So to get to "Open" you'd hit the left arrow and then hit enter:

Send, {Left}
Send, {Enter}


Another way would be hit Alt and then o. (the letter o)

Send, !o


----------



## Eric01 (May 25, 2011)

stantley said:


> When that dialog box comes up it looks like the default is "Cancel". So to get to "Open" you'd hit the left arrow and then hit enter:
> 
> Send, {Left}
> Send, {Enter}
> ...


THANK YOU!! That worked perfectly! I am starting to like this command language...


----------

