Jump to content

Recommended Posts

Posted

Hi,

 

Im trying to create a bat file to install Sophos. The batch file should check if the Sophos installed file exists and run if it doesn't.

 

The problem im getting is that if the file exists it still runs the command

 

 

IF exist C:\Windows\System32\SophosInstalled.txt (copy "\\SERVER\Apps\Sophos\SophosInstalled.txt" "C:\SophosInstalled.txt")

Posted (edited)
Not following the logic of your copy. It checks to see if a text file exists in C:\Windows\System32, then copies it to the root of C if it does? Edited by Jawloms
  • Thanks 1
Posted (edited)

think I neet a not exists oops. will give it a go

 

 

Update: sorry, my fault. Needed NOT exists. Not awake enough.

Edited by dany2010
Posted

Still not following the logic, either.

 

IF NOT EXIST C:\Windows\System32\SophosInstalled.txt (copy "\\SERVER\Apps\Sophos\SophosInstalled.txt" "C:\SophosInstalled.txt")

This script will continuously run every boot/login/$trigger because it's checking the local System32 for a file, and, if the file doesn't exist, it will copy a file (of the same name) from \\Server to the local machine.

But you've told it to copy to C:\ - Next time the script executes it will check System32 for SophosInstalled.txt just like it's been told to, and guess what? It still isn't there, so it'll re-copy the file (again to C:\)

 

Ad Infinitum

  • Thanks 1
Posted

Yeah, was juggling 10 things at once. That was me half way through testing to see if the administrator could only see the system32 directory.

 

Didnt try running like that but obviously copied at the wrong time.

  • 2 weeks later...
Posted
Why don't you push sophos out from the enterprise console? or have I missed something?

 

Another step in the install process to show everyone when they only just cope with clicking two tick boxes. Sometimes forget that to.

 

Where we only have 3 hours at the site I have setup mdt and wds so that once I click the go button I know it will work without me touching it again.

 

I have the console to roll out proxy and all the other settings automatically and the script to just install and contact the server.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...