473,804 Members | 3,067 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1608
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*****@discus sions.microsoft .comwrote in message
news:1A******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .comwrote in message
news:1A******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .comwrote in message
news:1A******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .comwrote in message
news:1A******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .comwrote in message
news:1A******** *************** ***********@mic rosoft.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******@golde n.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
2406
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 not browser proof so it doesn't work all the time. or doing it with a for() statement that writes every 20 sec the last unix time to a database, this doesn't work because the for() statements stops executing the rest of the page so that doesn't...
1
5096
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 am not able to find out what is the problem. I have "Interact with active desktop" unchecked. If I login after logoff, then rmiregistry is not responding though it shows the rmiregistry as "started" in "controlPanel->Admin->services". If I restart...
8
2769
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 this would be simple enough if the ASP didn't have any user input, but it does.
7
2541
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 Cheer JonBoy
2
4585
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 DATABASE event :
0
1911
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 : Shutdown/reboot/logoff. I have tried this : AddHandler Microsoft.Win32.SystemEvents.SessionEnding, AddressOf
3
2279
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 form before logoff. But I know that it run properly because when I log back in the form is there and works fine. So the form opened and run, but windows was already in the "logoff" screen with no desktop showing, so I missed the form. Is there any...
1
2728
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 logon and logoff, capturing username & IP address. I've currently got a test application to check the inputs & outputs and the business logic is using EventLog_OnEntryWritten to trap 538's & 540's. Unfortunately (and peculiarly) a physical logon...
1
2390
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 same backup for 2 years and I came in one morning and it just decided it would not work anymore. Histroy: * Windows 2003 Server
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10318
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10302
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9130
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2975
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.