dany2010 Posted February 12, 2014 Posted February 12, 2014 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")
Jawloms Posted February 12, 2014 Posted February 12, 2014 (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 February 12, 2014 by Jawloms 1
dany2010 Posted February 12, 2014 Author Posted February 12, 2014 (edited) think I neet a not exists oops. will give it a go Update: sorry, my fault. Needed NOT exists. Not awake enough. Edited February 12, 2014 by dany2010
Garacesh Posted February 12, 2014 Posted February 12, 2014 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 1
dany2010 Posted February 12, 2014 Author Posted February 12, 2014 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.
kennysarmy Posted February 25, 2014 Posted February 25, 2014 Why don't you push sophos out from the enterprise console? or have I missed something?
dany2010 Posted February 25, 2014 Author Posted February 25, 2014 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now