Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a headless PC, and sometimes when I shutdown, a program will get caught up on a close dialog that refuses to terminate. Unfortunately, the VNC service has been stopped already meaning I have to either hook up a keyboard/mouse or use RDP to connect.

Is there a way to make the VNC service stop later in the shutdown process?

share|improve this question
add comment

2 Answers 2

It would take a bit of experimentation, trial and error, but you could make a service that is currently late-closing dependent on vnc. This means that vnc could not close until this other service had stopped.

Perhaps the Workstation process would be a good target. Make this dependent on vnc, then vnc won't close until workstation has closed, and hopefully workstation won't close unless the desktop applications close properly.

Note that this also means that vnc would not start up until workstation was started. If you need the sequence to be different at startup and shutdown, you could use the sc.exe commmand to change the dependencies after bootup.

Here is how to set up dependencies with services.

share|improve this answer
add comment

Close first? I use a wee little utility called ClosingTime in XP, it also worked in 7. I usually just close explorer windows only (Which are set to return if I don't close them). it can be set to close any other things too. Its a normal program, you text edit the config with all the programs to close, and save the config. hit the shortcut and it tries to close them.

I suspect that there are other very tiny but usefull utilites of the same type , that would mass close things, by sending ALT [F4]s to thier windows. The Idea here would be to Manually inititate, which is safer.

In XP, there is also HungAppTimeout, and ServicesTimeout registry settings, found on tweak sites, these could be set for the number of miliseconds that is waited until the system forceably closes them even if a save requester is open :-O . If you ran the VNC as a service, then just make sure that the services time is longer than the app time. Caveat: Shortening the app time, when the service closes easily, would just cause problems, killing apps too fast.

autoHotkey? use a script in it to locate windows, and tell them to quit , before initiating a shutdown. Would require that the user script some things.

General Task Killing, with windows task killer cmd apps, or the PE executable, you can batch an ordered shutdown in any order you want with it. Those batch items have both ask and force options, so you can ask first then Kill later :-) in a batch. Shutdown could also be added to the end of the batch to finish.

Of course any forcable method would not allow the program to finish, and could terminate it while writing, or waiting for a user responce. sooo? I guess I would recommend a Close and ask first , as manually started, then apply the force on the shutdown itself. Terminating a program while writing to disk, can cause disk corruptions.

Uhh if any of these methods might work for you, I could spend more time writing them out.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.