PDA

View Full Version : All "Cheaters" check in here to go back to the straight and narrow...



RSmura
09-11-2006, 10:42 AM
I manage a bunch of clients, so touching all of them isn't practicle. That being said, I still have to make changes, like when our TEAM CAPTAIN MovieMan tells me I gotta get all my boxes off the "cheating" crunchers. Ok, here is the easy way:

@echo off
REM The next line checks to see if the "updates" folder exists and creates it if it does not.
if not exist c:\updates md c:\updates
REM the next line checks to see if boincupd.txt exists and exits the script if it does
if exist c:\updates\boincupd.txt exit

REM The next line stops the BOINC service from running
net stop BOINC
REM The next line runs a java script that kills boincmgr.exe using a .js included below:
CScript s:\KillProc.js boincmgr.exe
REM The next line copies the original cruncher files that you have placed at \\machinename\share\folder\ and overwrites any current files
copy \\machinename\share\folder\boinc.* "C:\Program Files\BOINC" /y
REM The next line creates that boincupd.txt so this won't run but once
dir "c:\Program Files\BOINC" > c:\updates\boincupd.txt
REM The next line starts your crunchers back up with stock files
net start BOINC

REM The next line is just your exit point if the files exist.
:EXIT

Copy and paste the above into notepad and save it as a .CMD file. This will make it execute when run. CALL the file from your logon script if you use one. i.e. if you save it as S:\boincupd.CMD then your logon script would say:

CALL "S:\boincupd.cmd"


Below is the .js file you will need to kill the running boincmgr. follow the directions inside the /*//////////////// lines... Keep in mind that you must place this .js file on a share that everyone can access since your logon script is going to call the .CMD that is going to call this .js on EVERY MACHINE.


/*////////////////////////////////////////////////////////////////////
FileName: KillProc.js

Copy this script to dir in path (C:\, C:\Winnt or C:\Windows,...)
From command line:
C:\>KillProc notepad.exe


Sript assumes:
- WMI (WinXP, Win2K or WinNT with WMI core),
- User running it must have administrative privileges.
*/////////////////////////////////////////////////////////////////////
var oShell = new ActiveXObject("Wscript.Shell");
var oArgs = WScript.Arguments;
var sArgsAry = new Array();
var sArgsLine = "";


// --- Make sure there are comand line parameters:
if (oArgs.length==0) {
sMsg = "Usage: \n\tC:\\>KillProc notepad.exe [winword.exe ...]"
WScript.Echo(sMsg);
WScript.Quit();



}


// --- Collect script arguments (if any):
for (var i=0; i<oArgs.length ; i++) {
// Collect passed arguments
sArgsLine += "\"" + oArgs(i) + "\" ";
sArgsAry[sArgsAry.length] = oArgs(i)


}


// --- Ensure that CScript.exe is the host:
if (!isCScript()) {
var sMsg = "CScript.exe must be used to run this script.\n\n";
sMsg += "To set CScript as the default host:\n\n";
sMsg += "C:\\>WScript //H:CScript";
WScript.Echo(sMsg);
WScript.Quit();


}


// --- Kill process(es):
for (var i=0; i<sArgsAry.length ; i++) {
WScript.Echo("Killing (if any): " + sArgsAry[i]);
KillProcess(sArgsAry[i]);


}


function KillProcess(sProg) {
try { var oWMI = GetObject("winmgmts:{impersonationLevel=impersonate,(Debug)}");
} catch(e) { return; }
var sQuery = "select * from win32_process where name='" + sProg + "'";
try { var oEnm = new Enumerator(oWMI.execquery(sQuery));
} catch(e) { return; }

for (;!oEnm.atEnd();oEnm.moveNext()) { oEnm.item().terminate(); }



}


function isCScript() { return (/cscript.exe$/i).test(WScript.FullName); }

// Branimir


If you have any questions, please feel free to ask me although I am not a scripting or Java expert.

Jose
09-11-2006, 10:44 AM
What the hell i s this?

Movieman
09-11-2006, 10:49 AM
What the hell i s this?
Nothing you have to worry about my friend..a script for the guy with 20+ machines to put them all back to the stock BOINC client..

Rob: Thanks my friend for doing this!:toast:
AND: I am NOT the team captain! I admit I was acting like one today but that was by circumstance and thats all.

RSmura
09-11-2006, 10:51 AM
Jose, if it looks like greek to you, es por que yo no hablo Espanol. Estudio por seis años en mi escuela, pero no tengo un opportunidad para hablar con la gente. Y, no tengo un teclado Espanol...

Jose
09-11-2006, 11:06 AM
anos :rolf: What about you having six ass holes :rofl:?

RSmura
09-11-2006, 11:11 AM
yeah, if I had a keyboard that did ennyay (how do you spell N with a tilde?) it wouldn't have said anus! That is why I added the last sentence since I knew you were going to give me crap about having six anuses...:slapass:

EDIT: There, I fixed años! It says six years now and not six anuses.... NICE!

brot
09-11-2006, 11:52 AM
brot@brotkastn ~ $ emerge =sci-misc/boinc-5.2.14 -av

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild R ] sci-misc/boinc-5.2.14 USE="X -server -unicode" 0 kB

Total size of downloads: 0 kB

Would you like to merge these packages? [Yes/No]

Read this as an advert for gentoo ;)

[XC] leviathan18
09-11-2006, 02:43 PM
bueno hay varias personas con las que puedes hablar, asi que si quieres me puedes agregar al msn para que practiques tu español y no pierdas tus 6 anos de estudio JAJAJAJAJAJA

itznfb
09-11-2006, 04:08 PM
nice batch skills ;)

WesM63
09-11-2006, 04:48 PM
batch FTW!!


btw, mine is changed over. The only other optimized one i have is my laptop, but thats running QMC.

Firechicken
09-11-2006, 05:39 PM
I thought I could do up a nice batch file, very nice job makes anything I would do look like ez logo on the old green screen appleII lol

RSmura
09-12-2006, 03:43 AM
bueno hay varias personas con las que puedes hablar, asi que si quieres me puedes agregar al msn para que practiques tu español y no pierdas tus 6 anos de estudio JAJAJAJAJAJA

mucho gusto y gracias. en MSN, soy RobATSmuraDOTcom.