473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Running a .Net app before logoff

Hi
I have a small .net Windows app that I need to run before the user logs off
the machine. This is a Windows App where a dialog is displayed to the user
and he/she needs to answer before the computer continues to logoff.
I currently have the application running as a logoff script. In other words
I use the Group Policy window to add the executable as a logoff script.
This works fine as long as the app is a console app. But if it's a windows
app that requires user input the logoff process hangs. It seems that windows
logs off before running the .exe and when it runs the .exe you can no longer
see the app window and windows hangs waitting for user input.

Any idea how I could run the app "before" the logoff happends?

Jul 9 '07 #1
6 1590
You might be able to do it "backwards".

I just read your post and what if you tried something like this:
http://www.eggheadcafe.com/tutorials...ff-reboot.aspx

and actually lock out the "log off" till after they run your program. -
then you enable the logoff.

Just a thought

Im too much of a newbie in .net to help any more - sorry.

Miro
"fhunter" <fh*****@discussions.microsoft.comwrote in message
news:1A**********************************@microsof t.com...
Hi
I have a small .net Windows app that I need to run before the user logs
off
the machine. This is a Windows App where a dialog is displayed to the user
and he/she needs to answer before the computer continues to logoff.
I currently have the application running as a logoff script. In other
words
I use the Group Policy window to add the executable as a logoff script.
This works fine as long as the app is a console app. But if it's a windows
app that requires user input the logoff process hangs. It seems that
windows
logs off before running the .exe and when it runs the .exe you can no
longer
see the app window and windows hangs waitting for user input.

Any idea how I could run the app "before" the logoff happends?

Jul 9 '07 #2

"fhunter" <fh*****@discussions.microsoft.comwrote in message
news:1A**********************************@microsof t.com...
Hi
I have a small .net Windows app that I need to run before the user logs
off
the machine. This is a Windows App where a dialog is displayed to the user
and he/she needs to answer before the computer continues to logoff.
I currently have the application running as a logoff script. In other
words
I use the Group Policy window to add the executable as a logoff script.
This works fine as long as the app is a console app. But if it's a windows
app that requires user input the logoff process hangs. It seems that
windows
logs off before running the .exe and when it runs the .exe you can no
longer
see the app window and windows hangs waitting for user input.

Any idea how I could run the app "before" the logoff happends?
So why can't you have a solution that's a Windows solution, that has no
form, no user interactions and not an console application?

That type of solution can be called when the user logs off and it won't
hang.
Jul 9 '07 #3
Great idea Miro, I think this might work.

"Miro" wrote:
You might be able to do it "backwards".

I just read your post and what if you tried something like this:
http://www.eggheadcafe.com/tutorials...ff-reboot.aspx

and actually lock out the "log off" till after they run your program. -
then you enable the logoff.

Just a thought

Im too much of a newbie in .net to help any more - sorry.

Miro
"fhunter" <fh*****@discussions.microsoft.comwrote in message
news:1A**********************************@microsof t.com...
Hi
I have a small .net Windows app that I need to run before the user logs
off
the machine. This is a Windows App where a dialog is displayed to the user
and he/she needs to answer before the computer continues to logoff.
I currently have the application running as a logoff script. In other
words
I use the Group Policy window to add the executable as a logoff script.
This works fine as long as the app is a console app. But if it's a windows
app that requires user input the logoff process hangs. It seems that
windows
logs off before running the .exe and when it runs the .exe you can no
longer
see the app window and windows hangs waitting for user input.

Any idea how I could run the app "before" the logoff happends?


Jul 10 '07 #4

I need the user input. I need then to enter some information.
"Mr. Arnold" wrote:
>
"fhunter" <fh*****@discussions.microsoft.comwrote in message
news:1A**********************************@microsof t.com...
Hi
I have a small .net Windows app that I need to run before the user logs
off
the machine. This is a Windows App where a dialog is displayed to the user
and he/she needs to answer before the computer continues to logoff.
I currently have the application running as a logoff script. In other
words
I use the Group Policy window to add the executable as a logoff script.
This works fine as long as the app is a console app. But if it's a windows
app that requires user input the logoff process hangs. It seems that
windows
logs off before running the .exe and when it runs the .exe you can no
longer
see the app window and windows hangs waitting for user input.

Any idea how I could run the app "before" the logoff happends?

So why can't you have a solution that's a Windows solution, that has no
form, no user interactions and not an console application?

That type of solution can be called when the user logs off and it won't
hang.
Jul 10 '07 #5
Only one problem, I can't figure out how to trap the logoff and lock it :(

"Miro" wrote:
You might be able to do it "backwards".

I just read your post and what if you tried something like this:
http://www.eggheadcafe.com/tutorials...ff-reboot.aspx

and actually lock out the "log off" till after they run your program. -
then you enable the logoff.

Just a thought

Im too much of a newbie in .net to help any more - sorry.

Miro
"fhunter" <fh*****@discussions.microsoft.comwrote in message
news:1A**********************************@microsof t.com...
Hi
I have a small .net Windows app that I need to run before the user logs
off
the machine. This is a Windows App where a dialog is displayed to the user
and he/she needs to answer before the computer continues to logoff.
I currently have the application running as a logoff script. In other
words
I use the Group Policy window to add the executable as a logoff script.
This works fine as long as the app is a console app. But if it's a windows
app that requires user input the logoff process hangs. It seems that
windows
logs off before running the .exe and when it runs the .exe you can no
longer
see the app window and windows hangs waitting for user input.

Any idea how I could run the app "before" the logoff happends?


Jul 10 '07 #6
On Mon, 9 Jul 2007 17:04:43 -0400, "Miro" <mi******@golden.netwrote:
>You might be able to do it "backwards".

I just read your post and what if you tried something like this:
http://www.eggheadcafe.com/tutorials...ff-reboot.aspx

and actually lock out the "log off" till after they run your program. -
then you enable the logoff.

Just a thought

Im too much of a newbie in .net to help any more - sorry.

Miro
Interesting idea ... but shutdown can be achieved through other means.
Like command line.

There should be a windows message that gets sent when the system is
shutting down that you can trap

--
http://bytes.thinkersroom.com
Jul 11 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Spam sucks | last post by:
Hello, If somebody could help me with this one it would be very nice, the story: I need to check if a user is online or not at the moment i am doing a user logoff with javascript but this is...
1
by: Arun Goel | last post by:
Hi all, I have set up rmiregistry.exe to run as service on Windows 2000 Server .. I set it up using "srvany.exe". It is running fine, but when I logoff, it stops.I did a lot of research but I...
8
by: Jonathan Heath | last post by:
Hi all, I have created an ASP script that enters data into an Access Database. My problem is that I'd like this script to run when the computer is shutdown or the user logs off. I think...
7
by: JonBoy | last post by:
Is it possible to put the logoff/shutdown/restart buttons on an ASP page or something similar? If so can anyone point me in the direction of some code please or where I can read how to do it ...
2
by: Michael | last post by:
Hi, I was creating a trigger to fire when a user ends a session, but I see that you could have it fire on a SCHEMA event : CREATE TRIGGER "SRU"."TEST" BEFORE LOGOFF ON "SRU".SCHEMA or a...
0
by: Allan Bredahl | last post by:
Hi All I am trying to construct an application that is able to cancel a machine shutdown, reboot or logoff. And after performing some stuff to perform the original shutdown order :...
3
by: =?Utf-8?B?Zmh1bnRlcg==?= | last post by:
I have a Windows Service that should pop a windows form right before logoff, for the user to enter some information. I got things working fairly well except that the user does not get to see the...
1
by: =?Utf-8?B?ZGpjYXNlbGV5?= | last post by:
I'm trying to write a service that will sit on the domain controller (or, if this proves to be impossible, to be rolled to all connecting Windows machines). It needs to get notification of each...
1
by: =?Utf-8?B?U3ludGF4IDM3NzA3?= | last post by:
I have found lots of people talking about this issue, but no one seems to have a solution. I could really use some help here. Has anyone seen this or have any ideas? I have been running the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.