General discussion

Locked

script to close a file on shutdown?

By Tink! ·
I have never written a script for Windows itself. I am somewhat familiar with VB script. What I want to do is have Windows end the process "WISPTIS.exe" before shutting down. I've noticed that if I don't end this process my computer won't shut down properly. a quick search shows that this file is used by Adobe Acrobat (which I do have installed).
So I either need a script to have it end before shutting the computer down, or find out if it's really necessary to keep this file.
Thanks!
Tink

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Shutdown Script

by BFilmFan In reply to script to close a file on ...

To reboot the local machine from a VBScript script, you can use the following code. For the code to work, Windows Management Instrumentation (WMI) must be installed on the machine you're rebooting.

Set OpSysSet =
GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery_
("select * from Win32_OperatingSystem where Primary=true")

for each OpSys in OpSysSet
OpSys.Reboot()
next
(The GetObject line wraps to two lines here because of space constraints.) To shut down the machine, change the OpSys.Reboot() line to OpSys.Shutdown().

You could also try the suggestions here:

http://www.microsoft.com/technet/scriptcenter/guide/sas_cpm_evqo.mspx

You can also close a particular process with this script:

Option Explicit

Dim objProcesses, objProcess

Set objProcesses = GetObject("WinMgmts:root/CIMV2").ExecQuery( _
"SELECT * FROM Win32_Process WHERE Name=WISPTIS.EXE'")

For Each objProcess In objProcesses
objProcess.Terminate
Next

Enjoy!

Collapse -

stupid question

by Tink! In reply to Shutdown Script

cool, thanks for the script now for the million dollar question: How do I utilise it? (where do I put it?)

Collapse -

Logoff Script

by BFilmFan In reply to stupid question

Group Policy can be used to assign Logoff, Startup, and Shutdown scripts. The Logoff script setting in Group Policy is ?User Configuration?, ?Windows Settings?, ?Scripts (Logon/Logoff)?, ?Logoff?. Similar to the Logon script setting, it applies to all users in the domain, site, or organizational unit that the GPO is assigned to. Startup and Shutdown scripts are in ?Computer Configuration?, ?Windows Settings?, ?Scripts (Startup/Shutdown)?. These scripts are applied to any computer in the domain, site, or organizational unit that the Group Policy is applied to.

Back to Windows Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums