Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search and Delete

Status
Not open for further replies.

Billybonga

IS-IT--Management
Jun 22, 2002
72
GB
Hi,

I'm wondering if any-one can help me. I'm an IT instructor Trainign a class for Comptia A+

Because of the nature of the class the students need fully administrative access to all PC's, but this is left me with the problem of restricting them from installing games etc.

Lately some have gotten their hands on Quake3. I'm pulling my hair out giving them warnings. What i want to do is run a .vbs script at start-up from the registry.
The VBS script will have to search for a particular file(s) and delete them if found.

The reason I need to do the search is that the simple script is written to presume the location onf c:\Program Files\etc

They are installing the games in different partitions and locations ... can anyone help

Cheers
 
Search this forum for 'recursive' or 'recursion'. That should get you started on how to search the entire harddrive for a file. Use the FileSystemObject for the deletion.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
I have used this script before to uninstall software from remote machines, in this example the VPN client. Obviously this script is dependant on your machines being able to run WMI script

strComputer = InputBox("Enter computer name:")
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery ("Select * from Win32_Product Where Name = 'Contivity VPN Client'")
For Each objSoftware in colSoftware
objSoftware.Uninstall()
wscript.echo "VPN Client has been uninstalled from PC " & strComputer
Next

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top