0

I want to know how to give a warning message to user using VB Script when he tries to shutdown or sleep windows and continue if he really want to do it.

I am currently wish to use such script in Windows 7 64 bit system.

How to do this using VB Script?

GTAVLover
  • 1,334
  • 2
  • 18
  • 36

1 Answers1

1

You are talking about hooking into Operating System to trigger the script when a shutdown is initiated. This type of functionality will not work well with a scripting language like VBScript which is designed to be lightweight and has no hooks into the Windows API.

This type of task is better suited to a fully featured language like C++, C# etc. If you are familiar with VBScript, you might have some success using VB.Net due to the similarity in syntax.

Closest you will get with VBScript is having the script itself initiate the shutdown rather than hooking into the Windows API, which is discussed in the question Yes/no shut down.

Community
  • 1
  • 1
user692942
  • 15,667
  • 7
  • 74
  • 164