Page 1 of 1 1
Topic Options
#189969 - 2008-10-01 04:50 PM SCRIPT TO DELETE GAMES - Solitaire and the like
UhOh Offline
Just in Town

Registered: 2007-07-17
Posts: 3
I've been tasked to remove all those old games that came with windows from all 7,000 hard drives in our environment. You know, solitaire, Freecell etc....

I've ran an SMS report that gives path's to all the exe's..... Folks have them peppered all over their hard drives....

What do the fine folks here on the forum think about a simple file ran from root "del sol.exe /s" script?
This seem a little dangerous too??
But then it would have to be ran again for freecell and the others.... This would pull a lot of system resources.
I can hear my clients calling the helpdesk already

I'm really not concerned about uninstalling the games just deleting the *.exe's

Surely there is a nice kix script already designed to do just this?

Any help would be greatly appreciated!!

Top
#189979 - 2008-10-02 08:28 AM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: UhOh]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
You could of course create gpo's that control what ppl CAN run, in example - ie,office etc etc - that way, even if someone clever comes up with the idea to rename the copied/moved file, there's really no sure way to run it properly. But, it smells like we're not talking real users here, since they seem to be able to copy files all over the system. I'll let someone smart find a better answer ;). Oh - and welcome to the board!
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#189984 - 2008-10-02 10:14 AM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: Björn]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
You could use the INF route and have the system auto uninstall them with a GPO

I would not do a DEL from the root as it could delete legitimate files of a similar name (if the user has rights).

Or run an uninstaller that supports monitoring and watch what gets modified on a removal and then write your removal script based on that.

Top
#190017 - 2008-10-03 10:37 PM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: NTDOC]
UhOh Offline
Just in Town

Registered: 2007-07-17
Posts: 3
Hello all thanks for the replies,

Here is something I got from another admin off the military forum.
This seem to work locally haven't pushed it via SMS yet but will soon.
I know, I know, it's not a kix script. VBS is below:

DIM WSHShell: Set WSHShell = CreateObject("WScript.Shell")
DIM Computer: Computer = WSHShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

Set colFiles = objWMIService.ExecQuery _
("Select * from CIM_DataFile Where Extension = 'exe' AND (FileName = 'sol' OR FileName = 'blah' OR FileName = 'stuff')")

For Each objFile in colFiles
objFile.Delete
Next

Top
#190018 - 2008-10-03 11:11 PM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: UhOh]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
As I said that is NOT a very elegant solution and you could easily delete files that are valid using a string name lookup alone.

You should take your time and figure out the locations and methods for appropriate removal (IMHO).

Surely if you have 7,000 workstations and SMS you have other resources and other Admins to help you out on this. If not I'll try to free up some time and find a better solution for you but no promises.

Top
#190066 - 2008-10-08 11:30 AM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: NTDOC]
Björn Offline
Korg Regular
*****

Registered: 2005-12-07
Posts: 953
Loc: Stockholm, Sweden.
A good practice is always to lock down users, and step by step 'unlock' features - this requires emense testing and time and should NOT be done in a production environment, for something as simple as remove games is tricky - when users have above 'user' rights..
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!

Top
#190113 - 2008-10-13 09:09 PM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: Björn]
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
If memory serves, there is a FAQ that was created to do this. However, I am with the school of thought that this is better served under a GPO.

You maybe able to leverage information here: http://www.gpanswers.com

Thanks,

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#190120 - 2008-10-14 06:19 PM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: Kdyer]
Reese_G Offline
Just in Town

Registered: 2005-04-18
Posts: 1
I am in a similar boat.

While I agree that GPO is the way to go, not everyone has it available. I just inherited a network of 800 pc's. Every user has admin rights, the domain is not controlled by me and I have no rights to manage it. The inmates are truly running the asylum here. I was hired to fix all this but it will be a long road.

I do have access and control over the login script. this is my best avenue for making and controlling changes.

for me it is "peggle.exe" and others from PopCap. I think some of the above script techniques will work.

I would like to take it a bit farther and leave the directory and registry entries there but empty and restrict permission on them so they can't be written to ever again.

Is CACLS the best choice for doing that?

Top
#190123 - 2008-10-15 12:03 AM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: Reese_G]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
If needed I would use xcacls and not cacls. If I recall correctly cacls had some issues that got fixed in xcacls.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#190183 - 2008-10-20 09:37 PM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: Mart]
UhOh Offline
Just in Town

Registered: 2007-07-17
Posts: 3
AN UPDATE: Thanks to all who replied.
THIS IS NO EASY TASK!!!!.

What I've done is use the WMI script above. That eliminates some of the games. But I'm thinking some are protected via WFP. So I used the INF uninstall process. These 2 processes have eleminated a LARGE % of the games. I will now use the SMS web report. to snag common paths and then delete those that are found via a KIX script......

NTDOC, I wish we had a lot of folks to help out here but there are only 3 of us. Of the other 2, 1 is a sharepoint admin, the other is a MOM admin and WEB server guy, so they are VERY busy.....
The Army is running on a tight budget.

Top
#190184 - 2008-10-20 10:07 PM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: UhOh]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
LOL - Well sorry about that. Thought my Tax dollars were going to better use. Guess it got funneled into the Big Investment Company buyouts

Okay, well I'm finishing up some other projects and another site I Moderate on I'm trying to finish up some tasks. Hopefully that will free up some time and I'll take a further look at this for you.

Cheers

Top
#190185 - 2008-10-20 10:58 PM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: NTDOC]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
how come sharepoint admin be busy?
or MOM slash WEB admin?

they are clearly just kicking back.
_________________________
!

download KiXnet

Top
#190193 - 2008-10-21 02:26 AM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: Lonkero]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Because Sharepoint is a piece of junk ;\)

I suppose a lot would depend on how many sites and users there are.

Top
#190267 - 2008-10-23 10:22 AM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: NTDOC]
Shaun_Hill Offline
Getting the hang of it

Registered: 2004-11-15
Posts: 50
Loc: JHB, South Africa
If you try delete games in the windows directory they will just reappear a few seconds later. I remember creating a script to do this but you could not do it by deleting the files. As a test go and delete sol.exe and watch how quickly it returns.

I suggest you use sysocmgr to script it. It's usage is described at this url:
http://ask-leo.com/how_can_i_disable_the_games_that_come_with_windows.html

Top
#190268 - 2008-10-23 10:24 AM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: Shaun_Hill]
Shaun_Hill Offline
Getting the hang of it

Registered: 2004-11-15
Posts: 50
Loc: JHB, South Africa
Better example here:
http://www.sophos.com/support/knowledgebase/article/22627.html

Top
#190285 - 2008-10-23 05:43 PM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: Shaun_Hill]
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
 Originally Posted By: Shaun_Hill


Shaun -
Thank you for sharing that. The article appears to cover the need. Now, he just needs to insure that any new system that is imaged does not have the games installed. \:D

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#190303 - 2008-10-24 11:10 AM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: Kdyer]
Shaun_Hill Offline
Getting the hang of it

Registered: 2004-11-15
Posts: 50
Loc: JHB, South Africa
Create the Gamelist file:
[components]
freecell=off
hearts=off
minesweeper=off
pinball=off
solitaire=off
spider=off
zonegames=off

Here is the script:

 Code:
$GamesList = @LSERVER + "\NETLOGON\GamesList.txt"
? "Games removal script processing..."
Shell "%WINDIR%\SYSTEM32\sysocmgr.exe /i:%windir%\inf\sysoc.inf /u:" + $GamesList + " /q /r"

Top
#190525 - 2008-11-06 07:35 PM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: Shaun_Hill]
DocT Offline
Just in Town

Registered: 2008-01-16
Posts: 1
Here's a very simple way to simply NOT allow the games and other software run. Simply add or remove EXE files to the $disallowapps line. (Thanks to RADIMUS some time ago for this one!)

;? " Disable Microsoft Games and Search Engines"
$=writevalue('HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer','DisallowRun',1,REG_DWORD)
$disallowapps=split('sol.exe freecell.exe winmine.exe pinball.exe spider.exe GoogleDesktop.exe YahooDesktopSearch.exe WindowsSearch.exe WindowsSearchfilter.exe WindowsSearchIndexer.exe WindowsSearchSafeFilter.exe msnmusic.exe quicktimeplayer.exe')
for $loop = 0 to ubound($disallowapps)
$=writevalue('HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun',$loop +1, $disallowapps[$loop],REG_SZ)
next

Top
#190527 - 2008-11-06 08:16 PM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: DocT]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Removal would probably be best, but here are MS articles if you want to go the no run route.

Restrict Users from Running Specific Windows Programs
DisallowRun

Top
#190742 - 2008-11-24 07:39 PM Re: SCRIPT TO DELETE GAMES - Solitaire and the like [Re: UhOh]
johnewagner Offline
Fresh Scripter

Registered: 2005-12-21
Posts: 7
Here is two more ways to skin that cat.

vbs script in startup script.
 Code:
' (c) 2006 Plamdi.com. This file silently uninstalls the Google and Yahoo! Toolbars.
Option Explicit:On Error Resume Next
Dim WshShell,a,i:i=0:Set WshShell=WScript.CreateObject("WScript.Shell")
a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2318C2B1-4965-11d4-9B18-009027A5CD4F}\UninstallString")
If a<>"" Then WshShell.Run(a&" /S"),1,True:i=i+1
a=WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Yahoo! Companion\UninstallString")
If a<>"" Then WshShell.Run(""""&a&""" /S"),1,True:i=i+1
WshShell=Nothing:Wscript.Quit(i)


Modify for the app you want to unistall.

Or

Create a GPO:

User Configuration\Administrative templates\System\Policy\Don't run Specified Windows Applications\Insert desired apps. This can be done with registry settings.

Develop a business case for GPO's.

I would also be very careful about deleting files or remote clients. If you delete files that controls the nic or OS, you will be spending a lot of time imaging.

If you take away the admin rights, a lot of the script controlled computer mods will not work.


Edited by johnewagner (2008-11-24 07:40 PM)

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 293 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.169 seconds in which 0.072 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org