Ruigerock Posted November 7, 2006 Posted November 7, 2006 (edited) Since a week ago i've added some autoit functions into the company's loginscript and i want to tweak it a little bit more. We use Windows Defender in our company and not all the computers have this installed. So i wrote this code to see which computers are missing Windows Defender. If Not FileExists (@ProgramFilesDir & "\Windows Defender\MSASCui.exe") Then $file = FileOpen("\\server01\log$\Windows Defender log.txt", 1) FileWriteLine($file, @MDAY & "-" & @MON & "-" & @YEAR & " " & @HOUR & ":" & @MIN & " op " & @ComputerName & " is geen Windows Defender geconstateerd, username gebruikt bij opstarten is " & @UserName) FileClose($file) EndIfoÝ÷ Ø(®K)z·ÞrÙrnëZZ.®Ç«½êìv÷öØZ½å¢Ú0°7zw^®)쵩eyÔ¨%¢Ú0°7zw^®Z ·b±ø¥)àº"¶®÷«©±©Ý§ßÛm¡«èÛaÀn¶'m~(.ê.¶0¶hÑhìZ^f wZ.®Ç«½êìj·§jg±êïz½5±êïz½6±êïz½7z×Á©í¶uªîëajض¢jnµêçjg¢{Z{-ì(Û®÷«¶§²H©¶W®+^.)Þjëh×6If Not @computername = "server??" Then FileWriteLine etc.. etc.. doesn't work. Anyone ideas? Edited November 7, 2006 by Ruigerock
4gotn1 Posted November 7, 2006 Posted November 7, 2006 (edited) Dim $CompName = @Computername If StringInStr($CompName, "Server") Then ;Skip file write Else ;FileWriteLine() EndIf Edited November 7, 2006 by 4gotn1
Ruigerock Posted November 7, 2006 Author Posted November 7, 2006 (edited) Dim $CompName = @Computername If StringInStr($CompName, "Server") Then ;Skip file write Else ;FileWriteLine() EndIf oÝ÷ Ûú®¢×©ä³(¶}HßÛÞ,^v+n¦Ú zØ^¯Ø^~*춫µ«¢+Ù¥´ÀÌØí ½µÁ9µô ½µÁÕÑɹµ)%9½Ð¥±á¥ÍÑÌ¡Aɽɵ¥±Í¥ÈµÀìÅÕ½ÐìÀäÈí]¥¹½Ý̹ÈÀäÈí5MM Õ¤¹áÅÕ½Ðì¤Q¡¸(%9½ÐMÑÉ¥¹%¹MÑÈ ÀÌØí ½µÁ9µ°ÅÕ½ÐíMÉÙÈÅÕ½Ðì¤Q¡¸(ÀÌØí¥±ô¥±=Á¸ ÅÕ½ÐìÀäÈìÀäÈíÍÉÙÈÀÄÀäÈí±½ÀÌØìÀäÈí]¥¹½Ý̹ȱ½¹ÑáÐÅÕ½Ðì°Ä¤(¥±]É¥Ñ1¥¹ ÀÌØí¥±°5dµÀìÅÕ½Ðì´ÅÕ½ÐìµÀì5=8µÀìÅÕ½Ðì´ÅÕ½ÐìµÀìeHµÀìÅÕ½ÐìÅÕ½ÐìµÀì!=UHµÀìÅÕ½ÐìèÅÕ½ÐìµÀì5%8µÀìÅÕ½Ðì½ÀÅÕ½ÐìµÀì ½µÁÕÑÉ9µµÀìÅÕ½Ðì¥Ì¸]¥¹½Ý̹Ƚ¹ÍÑÑÉ°ÕÍɹµÉեХ¨½ÁÍÑÉѸ¥ÌÅÕ½ÐìµÀìUÍÉ9µ¤(¥± ±½Í ÀÌØí¥±¤(¹%)¹% Works great! Edited November 7, 2006 by Ruigerock
Ruigerock Posted November 7, 2006 Author Posted November 7, 2006 Hmm i faced another problem If Not StringInStr($CompName, "Server")
MadBoy Posted November 7, 2006 Posted November 7, 2006 Hmm i faced another problem If Not StringInStr($CompName, "Server") If Not StringInStr($CompName, "Server") OR Not StringInStr($CompName, "Fax") OR Not StringInStr($CompName, "Mail") Maybe ? My little company: Evotec (PL version: Evotec)
Ruigerock Posted November 8, 2006 Author Posted November 8, 2006 If Not StringInStr($CompName, "Server") OR Not StringInStr($CompName, "Fax") OR Not StringInStr($CompName, "Mail") Maybe ?He Madboy, I've tried your code but it didn't work, "fax" still made a FileWriteLineSo i kept trying different combinations and eventually when i used "AND" in stead of "OR" it started working.Thanks all..
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