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
Post a Comment