MarkK
bit cruncher
- Local time
- Today, 09:36
- Joined
- Mar 17, 2004
- Messages
- 8,435
Here's part of my update script that I use to update the FE on clients machines. It kills any running instances of MS Access that it finds on the target machine. If your IT guys have it all locked down this might not work either, and probably you'll have to point it at other machines besides localhost.
But if I needed to kill Access at a particular time of day, I would run something like this as a scheduled task under windows . . .
But if I needed to kill Access at a particular time of day, I would run something like this as a scheduled task under windows . . .
Code:
Set service = GetObject("winmgmts:{impersonationLevel=impersonate}!\\localhost\root\cimv2")
Set procs = service.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'msaccess.exe'")
Do while procs.Count > 0
WScript.Sleep 500
i = i + 1
Set procs = service.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'msaccess.exe'")
if i > 20 then
For Each proc In procs
proc.Terminate
Next
End If
Loop