vbscript - Auto logoff when user close notepad .vbs -


i need script in vbs open notepad , logoff computer when user closed notepad. have code open

dim objshell set objshell = wscript.createobject( "wscript.shell" ) objshell.run("""c:\program files\mozilla firefox\firefox.exe""") set objshell = nothing 

and logoff

dim oshell set oshell = createobject("shell.application") oshell.shutdownwindows 

but need compare this. help.

you can use single script, waiting end of notepad (or firefox) process, shutting down windows, this:

dim objshell set objshell = wscript.createobject( "wscript.shell" ) 'run command reference : http://msdn.microsoft.com/en-us/library/d5fk67ky%28v=vs.84%29.aspx objshell.run """c:\program files\mozilla firefox\firefox.exe""", 1, true set objshell = nothing 'logoff dim oshell set oshell = createobject("shell.application") oshell.shutdownwindows 

nb: "oshell.shutdownwindows" won't force shutdown display shutdown dialog.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -