How to get rid of security warning when running batch script on network drive

3

1

I have seen the following question, but this is different: Get rid of Vista security warning

I wanted to make a convenience .bat script for fast cleanup (deleting several files in current directory). If i make such a .bat script in my home folder on my local computer, I can run it freely without security warnings.

However, when I copy it to H: (which resides on some central server, not my computer), I will suddenly start to get security warnings (of the type "Open File - Security Warning"). How can I get rid of this?

Notice that this is a .bat script. When you rightclick and choose properties on an .exe file, you will get the option to "unblock" the application. For .bat scripts, I do not seem to get that option though.

EDIT: Preferrably i would like a solution which does not require administrator permissions, if possible.

Alderath

Posted 2011-12-12T10:57:03.480

Reputation: 131

Answers

4

Have you tried adding the network server to your trusted sites in Internet Explorer?

baldy

Posted 2011-12-12T10:57:03.480

Reputation: 256

I added the ip adress and the hostname off the network server in IE trusted sites. For the ip adress i tried adding both xxx.xxx.xxx.xxx and http://xxx.xxx.xxx.xxx. Neither of those additions seeemed to fix the problem though. Do the setttings for internet explorer also apply to the normal file explorer? Or is there a specific place where i can add trusted sites to the file explorer? – Alderath – 2011-12-12T16:08:55.297

You'll also need to make sure the Trusted Site security settings allow programs to run without prompting. By default, it still prompts.And yes, these settings also apply to Explorer. – surfasb – 2011-12-12T19:16:52.957

you add the server using the normal UNC style \servername @surfasb good point, yes. – baldy – 2011-12-13T09:59:08.597

@badly: You can add that to your answer for future readers: – surfasb – 2011-12-13T15:16:53.690

I tried adding the \servername to trusted sites, as well as going into Internet Options -> Security -> Trusted Sites -> Custom Settings and, under Miscellaneous changing "Launching applications and unsafe files" from Prompt to Enable. Unfortunately, i still get the same warning when trying to run the batch script. – Alderath – 2011-12-14T10:07:25.127

Try adding the full UNC path where the batch file resides instead of just the server name, it's working on my side. – baldy – 2011-12-15T13:43:04.693

2

adding *.bat files to the low risk file types solves this. Explanation here, or in short:

  • run gpedit.msc
  • navigate to User Configuration->Administrative Templates->Windows Components->Attachment Manager
  • double click Inclusion list for low file types
  • click Enabled and add *.bat to the list
  • click Apply, this takes effect immedeately

stijn

Posted 2011-12-12T10:57:03.480

Reputation: 1 977

I was primarily looking for a way to disable the security warning for one particular file, as opposed to the security warning for all files of a certain file type. Despite this, I attempted to use your solution. However, unfortunately this does not work under my particular circumstances, as I do not have admin rights on my machine (and such rights are apparently needed to run gpedit.msc). – Alderath – 2011-12-12T16:11:58.867

2

I had this problem, and used the solution that stijn provided. However, as of this morning, the warning returned. I checked, and the Group Policy was still in place, so I'm wondering if perhaps the new Windows Update changed something? Regardless, the solution I had to use was to create a shortcut to the .cmd files, and then in Properties > Advanced I selected "Run as Administrator". Not the most eloquent solution, but for my purposes, it works. I'd really like to know why this stopped working, and what I could do to make it work again, though.

Lucas Fowler

Posted 2011-12-12T10:57:03.480

Reputation: 31